Skip to content

Commit

Permalink
add clap --version and descrition for subcommand
Browse files Browse the repository at this point in the history
now when running it like `cargo sweep`, the --version is available,
which is necessary for when cargo-sweep is ran via cargo, also, --help
shows the crate description (from TOML manifest)
  • Loading branch information
marcospb19 committed Jan 17, 2023
1 parent 7f48bf4 commit a1ae53d
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,15 @@ pub enum SweepCommand {

#[derive(Parser, Debug)]
#[cfg_attr(test, derive(Default, PartialEq))]
#[command(group(
ArgGroup::new("criterion")
.required(true)
.args(["stamp", "file", "time", "installed", "toolchains", "maxsize"])
))]
#[command(
about,
version,
group(
ArgGroup::new("criterion")
.required(true)
.args(["stamp", "file", "time", "installed", "toolchains", "maxsize"])
)
)]
pub struct Args {
/// Path to check
pub path: Option<PathBuf>,
Expand Down

0 comments on commit a1ae53d

Please sign in to comment.