summaryrefslogtreecommitdiff
path: root/src/cmd.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-07-15 17:34:08 +0300
committerLars Wirzenius <liw@liw.fi>2021-07-15 17:34:08 +0300
commit80bd48f44c1ba6c5010f7d50fd9387b1c4424464 (patch)
tree94381a10bea6990ca5d017bb9067749f17ce614c /src/cmd.rs
parent0f3eeccc4403ddf27ad4e7cdffb8033dcab5f9cf (diff)
downloadjt2-80bd48f44c1ba6c5010f7d50fd9387b1c4424464.tar.gz
feat: add command to list current drafts
Sponsored-by: author
Diffstat (limited to 'src/cmd.rs')
-rw-r--r--src/cmd.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/cmd.rs b/src/cmd.rs
index da917ee..2f2f626 100644
--- a/src/cmd.rs
+++ b/src/cmd.rs
@@ -62,6 +62,17 @@ impl New {
}
#[derive(Debug, StructOpt)]
+pub struct List {}
+
+impl List {
+ pub fn run(&self, config: &Configuration) -> Result<(), JournalError> {
+ let journal = Journal::new(&config.dirname, &config.entries)?;
+ journal.list_drafts()?;
+ Ok(())
+ }
+}
+
+#[derive(Debug, StructOpt)]
pub struct NewTopic {
#[structopt(help = "Path to topic page in journal")]
path: PathBuf,