Skip to content

Commit

Permalink
style: Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Feb 22, 2022
1 parent f7419ec commit cb9cb25
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/tutorial_derive/03_04_subcommands_alt.rs
@@ -1,4 +1,4 @@
use clap::{Parser, Subcommand, Args};
use clap::{Args, Parser, Subcommand};

#[derive(Parser)]
#[clap(author, version, about, long_about = None)]
Expand All @@ -16,7 +16,7 @@ enum Commands {

#[derive(Args)]
struct Add {
name: Option<String>
name: Option<String>,
}

fn main() {
Expand All @@ -25,8 +25,8 @@ fn main() {
// You can check for the existence of subcommands, and if found use their
// matches just as you would the top level cmd
match &cli.command {
Commands::Add { name } => {
println!("'myapp add' was used, name is: {:?}", name)
Commands::Add(name) => {
println!("'myapp add' was used, name is: {:?}", name.name)
}
}
}

0 comments on commit cb9cb25

Please sign in to comment.