summaryrefslogtreecommitdiff
path: root/src/cmd.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd.rs')
-rw-r--r--src/cmd.rs32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/cmd.rs b/src/cmd.rs
index 9cec3b5..07f985f 100644
--- a/src/cmd.rs
+++ b/src/cmd.rs
@@ -1,11 +1,11 @@
use crate::config::Configuration;
use crate::error::JournalError;
use crate::journal::Journal;
+use clap::Parser;
use log::debug;
use std::path::PathBuf;
-use structopt::StructOpt;
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct Config {}
impl Config {
@@ -15,12 +15,12 @@ impl Config {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct Init {
- #[structopt(help = "Short name for journal")]
+ #[clap(help = "Short name for journal")]
journalname: String,
- #[structopt(help = "Short description of journal, its title")]
+ #[clap(help = "Short description of journal, its title")]
description: String,
}
@@ -35,7 +35,7 @@ impl Init {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct IsJournal {}
impl IsJournal {
@@ -49,12 +49,12 @@ impl IsJournal {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct New {
- #[structopt(help = "Title of new draft")]
+ #[clap(help = "Title of new draft")]
title: String,
- #[structopt(long, help = "Add link to a topic page")]
+ #[clap(long, help = "Add link to a topic page")]
topic: Option<PathBuf>,
}
@@ -66,7 +66,7 @@ impl New {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct List {}
impl List {
@@ -77,12 +77,12 @@ impl List {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct NewTopic {
- #[structopt(help = "Path to topic page in journal")]
+ #[clap(help = "Path to topic page in journal")]
path: PathBuf,
- #[structopt(help = "Title of topic page")]
+ #[clap(help = "Title of topic page")]
title: String,
}
@@ -94,7 +94,7 @@ impl NewTopic {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct Edit {
/// Draft id.
draft: String,
@@ -109,7 +109,7 @@ impl Edit {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct Remove {
/// Draft id.
draft: String,
@@ -124,7 +124,7 @@ impl Remove {
}
}
-#[derive(Debug, StructOpt)]
+#[derive(Debug, Parser)]
pub struct Finish {
/// Draft id.
draft: String,