From a1ae53dd08ce757aed2fdc4539d9ae38c273b549 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20M=2E=20Bezerra?= Date: Tue, 17 Jan 2023 01:20:52 -0300 Subject: [PATCH] add clap --version and descrition for subcommand 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) --- src/cli.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/cli.rs b/src/cli.rs index b0b5441..91a0613 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -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,