Merge pull request #5 from helloimalemur/count_only_flag

clap changes
This commit is contained in:
Koonts 2024-03-29 17:02:48 -04:00 committed by GitHub
commit f297cccbf7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 8 deletions

View File

@ -11,8 +11,8 @@ cargo install --path ./
Usage: sys-compare <COMMAND>
Commands:
create
compare
create Create a snapshot
compare Compare two snapshots
help Print this message or the help of the given subcommand(s)
Options:
@ -24,8 +24,8 @@ Options:
Usage: sys-compare create --root-dir <ROOT_DIR> --output-path <OUTPUT_PATH>
Options:
-r, --root-dir <ROOT_DIR>
-o, --output-path <OUTPUT_PATH>
-r, --root-dir <ROOT_DIR> Directory to create snapshot from
-o, --output-path <OUTPUT_PATH> Snapshot output/save location
-h, --help Print help
```
@ -34,10 +34,10 @@ Options:
Usage: sys-compare compare [OPTIONS] --left <LEFT> --right <RIGHT>
Options:
-l, --left <LEFT>
-r, --right <RIGHT>
-s, --selection <SELECTION>
-c <COUNT_ONLY> [possible values: true, false]
-l, --left <LEFT> left side of diff
-r, --right <RIGHT> right side of diff
-s, --selection <SELECTION> OPTIONAL: specify which change type specifically to return
-c <COUNT_ONLY> OPTIONAL: when using selection specify to return count only or not [possible values: true, false]
-h, --help Print help
```

View File

@ -9,19 +9,27 @@ pub struct Arguments {
#[derive(Subcommand, Clone, Debug)]
pub enum Commands {
/// Create a snapshot
Create {
/// Directory to create snapshot from
#[arg(short, long)]
root_dir: String,
/// Snapshot output/save location
#[arg(short, long)]
output_path: String,
},
/// Compare two snapshots
Compare {
/// left side of diff
#[arg(short, long)]
left: String,
/// right side of diff
#[arg(short, long)]
right: String,
/// OPTIONAL: specify which change type specifically to return
#[arg(short, long)]
selection: Option<String>,
/// OPTIONAL: when using selection specify to return count only or not
#[arg(short)]
count_only: Option<bool>,
},