0

I am making a Rust CLI program that uses Clap to parse arguments.

I made something like this.

#[derive(Subcommand)]
enum SubType {
    /// Operate on entries
    Operate(Entries),

    /// Generate entries
    Generate(Entries)
}

#[derive(Args)]
pub struct Entries {
    /// Hint for this <-- Label that I want to show differently for both generate and operate
    #[arg(value_parser)]
    pub entries: Vec<String>
}

How can I do this?

E_net4
  • 27,810
  • 13
  • 101
  • 139
decipher
  • 11
  • 2
  • Why not just make two different `OperationEntries` and `GenerateEntries` structs with different comments? You can use macros to duplicate the rest of the fields if required. – virchau13 Aug 21 '23 at 13:35

0 Answers0