You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use std::process::exit;use clap::{Parser,Subcommand};use clap::ArgAction::SetTrue;mod list;mod new;mod setup;#[derive(Parser)]#[clap(about, version, author)]structValue{#[clap(subcommand)]command:Commands,}#[derive(Subcommand)]enumCommands{/// List client platforms and repositoriesList{#[clap(long = "ssh", action = SetTrue, exclusive = true, required_unless_present_any = ["clients"])]/// List all platform ssh key aliasssh:bool,#[clap(long = "clients", action = SetTrue, exclusive = true, required_unless_present_any = ["ssh"])]/// List all clients)]clients:bool,}}fnmain(){let value = Value::parse();match&value.command{Commands::List{
ssh,
clients,} => {if ssh.to_string() == "true"{match list::platforms(){Ok(_) => exit(0),Err(err) => {eprintln!("ERROR: {}", err);exit(1);}};}if clients.to_string() == "true"{match list::clients(){Ok(_) => exit(0),Err(err) => {eprintln!("ERROR: {}", err);exit(1);}}}}}}
Steps to reproduce the bug with the above code
cargo run list
Actual Behaviour
error:The following required arguments were not provided:
--ssh
--clients
Usage: grabber list --ssh --clients
For more information try '--help'
Expected Behaviour
error:One of the following required arguments were not provided:
--ssh
--clients
Usage: grabber list --ssh || grabber list --clients
For more information try '--help'
Additional Context
With the exclusive method, --ssh and --clients arguments can't be used together. The usage message doesn't representate this behaviour.
If you run the usage message works as expected printing that it can't be used with one or more of the other specified arguments:
error:The argument '--ssh' cannot be used with one or more of the other specified arguments
Usage: grabber list [OPTIONS]For more information try '--help'
Debug Output
No response
The text was updated successfully, but these errors were encountered:
Due to the complexity of supporting the inferring of this while we provide a more direct way for users to request this, I'm going to go ahead and close this. If there is something I missed, we can look into re-opening this.
Please complete the following tasks
Rust Version
rustc 1.63.0 (4b91a6ea7 2022-08-08)
Clap Version
"4.0.18"
Minimal reproducible code
Steps to reproduce the bug with the above code
cargo run list
Actual Behaviour
Expected Behaviour
Additional Context
With the exclusive method,
--ssh
and--clients
arguments can't be used together. The usage message doesn't representate this behaviour.If you run the usage message works as expected printing that it can't be used with one or more of the other specified arguments:
Debug Output
No response
The text was updated successfully, but these errors were encountered: