summaryrefslogtreecommitdiff
path: root/src/opt.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/opt.rs')
-rw-r--r--src/opt.rs42
1 files changed, 8 insertions, 34 deletions
diff --git a/src/opt.rs b/src/opt.rs
index 4e6f46d..7d3dcda 100644
--- a/src/opt.rs
+++ b/src/opt.rs
@@ -1,5 +1,6 @@
//! Command line options.
+use crate::cmd;
use std::path::PathBuf;
use structopt::StructOpt;
@@ -46,50 +47,23 @@ pub struct GlobalOptions {
#[derive(Debug, StructOpt)]
pub enum SubCommand {
/// Show configuration.
- Config,
+ Config(cmd::Config),
/// Create a new journal in the chosen directory.
- Init {
- #[structopt(help = "Short name for journal")]
- journalname: String,
-
- #[structopt(help = "Short description of journal, its title")]
- description: String,
- },
+ Init(cmd::Init),
/// Check if a directory is a journal.
- IsJournal,
+ IsJournal(cmd::IsJournal),
/// Create draft for a new journal entry.
- New {
- #[structopt(help = "Title of new draft")]
- title: String,
-
- #[structopt(long, help = "Add link to a topic page")]
- topic: Option<PathBuf>,
- },
+ New(cmd::New),
/// Create topic page.
- NewTopic {
- #[structopt(help = "Path to topic page in journal")]
- path: PathBuf,
-
- #[structopt(help = "Title of topic page")]
- title: String,
- },
+ NewTopic(cmd::NewTopic),
/// Invoke editor on journal entry draft.
- Edit {
- /// Draft id.
- draft: String,
- },
+ Edit(cmd::Edit),
/// Finish a journal entry draft.
- Finish {
- /// Draft id.
- draft: String,
-
- /// Set base name of published file.
- basename: String,
- },
+ Finish(cmd::Finish),
}