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 ad0e736
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
- [BREAKING] Key profiles/chains/requests by ID in collection file
- [BREAKING] Move request history from `slumber/{id}.sqlite` to `slumber/{id}/state.sqlite`
- Request history will be lost. If you want to recover it, you can move the old file to the new location (use `slumber show` to find the directory location)
- [BREAKING] `show` subcommand now takes a `target` argument
- Right now the only option is `slumber show dir`, which has the same behavior as the old `slumber show` (except now it prints the bare directory)
- Hide sensitive chain values in preview
- Change fullscreen keybinding from F11 to F
- F11 in some cases is eaten by the IDE or OS, which is annoying
Expand Down
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 ad0e736

Please sign in to comment.