Skip to content

Commit

Permalink
add title support to edit command
Browse files Browse the repository at this point in the history
  • Loading branch information
bouzuya committed Nov 21, 2021
1 parent d8141cd commit 6765bc7
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions crates/application/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,11 @@ enum Subcommand {
about = "Creates a new memo that obsoletes the specified memo"
)]
Edit {
#[structopt(name = "ID_LIKE", help = "the id of the memo to edit")]
id_like: String,
#[structopt(
name = "ID_LIKE_OR_TITLE",
help = "the id or title of the memo to edit"
)]
id_like_or_title: String,
},
#[structopt(name = "insert-links", about = "Inserts links into the memo")]
InsertLinks {
Expand Down Expand Up @@ -71,7 +74,9 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
let app = App::new(data_dir);
let opt = Opt::from_args();
match opt.subcommand {
Subcommand::Edit { id_like } => crate::command::edit(app, id_like.as_str())?,
Subcommand::Edit { id_like_or_title } => {
crate::command::edit(app, id_like_or_title.as_str())?
}
Subcommand::InsertLinks { id_like } => crate::command::insert_links(app, id_like.as_str())?,
Subcommand::Link { id_like_or_title } => crate::command::link(id_like_or_title.as_str())?,
Subcommand::List { obsoleted } => crate::command::list(app, obsoleted)?,
Expand Down

0 comments on commit 6765bc7

Please sign in to comment.