Skip to content

Commit

Permalink
Add sub-sub-command to show
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPickering committed Dec 6, 2023
1 parent 86ba953 commit 08283a7
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,16 @@ pub enum Subcommand {
},

/// Show meta information about slumber
Show,
Show {
#[command(subcommand)]
target: ShowTarget,
},
}

#[derive(Copy, Clone, Debug, clap::Subcommand)]
pub enum ShowTarget {
/// Show the directory where slumber stores data and log files
Dir,
}

impl Subcommand {
Expand Down Expand Up @@ -147,8 +156,10 @@ impl Subcommand {
Ok(())
}

Subcommand::Show => {
println!("Directory: {}", Directory::root());
Subcommand::Show { target } => {
match target {
ShowTarget::Dir => println!("{}", Directory::root()),
}
Ok(())
}
}
Expand Down

0 comments on commit 08283a7

Please sign in to comment.