Skip to content

Commit

Permalink
simpler management of subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
glehmann committed Feb 2, 2024
1 parent 513a2f2 commit c1ad3c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use clap_verbosity_flag::{InfoLevel, Verbosity};

/// A simple tool to manage encrypted secrets in YAML files with age encryption
#[derive(Parser, Debug)]
#[command(author, version, about, long_about = None, arg_required_else_help = true)]
#[command(author, version, about, long_about = None)]
pub struct Cli {
/// Generate the completion code for this shell
#[arg(long, name = "SHELL")]
Expand All @@ -15,7 +15,7 @@ pub struct Cli {
pub verbose: Verbosity<InfoLevel>,

#[command(subcommand)]
pub command: Option<Commands>,
pub command: Commands,

#[arg(long, hide = true)]
pub markdown_help: bool,
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ fn run() -> error::Result<()> {
return Ok(());
}

match cli.command.unwrap() {
match cli.command {
cli::Commands::Keygen(ref args) => keygen::keygen(args)?,
cli::Commands::Pubkey(ref args) => pubkey::pubkey(args)?,
cli::Commands::Edit(ref args) => edit::edit(args)?,
Expand Down

0 comments on commit c1ad3c9

Please sign in to comment.