Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add sub-sub-command to show #72

Merged
merged 1 commit into from
Dec 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading