diff --git a/src/main.rs b/src/main.rs index ed5c4a9..9034e4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -39,7 +39,7 @@ fn run_command(command: opts::Command) -> Result { let local = Local::auto_open()?; local.switch_id(&args.id)? } - opts::Command::Edit(cmd) => match cmd { + opts::Command::Id(opts::Id::Edit(args)) => match args { opts::Edit::Readme => { let local = crev_lib::Local::auto_open()?; local.edit_readme()?; diff --git a/src/opts.rs b/src/opts.rs index e6b36c6..1e0ed4e 100644 --- a/src/opts.rs +++ b/src/opts.rs @@ -274,6 +274,10 @@ pub enum Id { /// Change current Id #[structopt(name = "switch")] Switch(SwitchId), + + /// Edit README.md of the current ID + #[structopt(name = "edit")] + Edit(Edit), } #[derive(Debug, StructOpt, Clone)] @@ -397,10 +401,6 @@ pub enum Command { #[structopt(name = "id", alias = "new")] Id(Id), - /// Edit README.md of the current Id, ... - #[structopt(name = "edit")] - Edit(Edit), - /// Query Ids, packages, reviews... #[structopt(name = "query")] Query(Query),