Skip to content

Commit

Permalink
docs(ref): Be more explicit with ArgEnums
Browse files Browse the repository at this point in the history
  • Loading branch information
epage committed Apr 30, 2022
1 parent 0a1cfe3 commit d411e7a
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions examples/derive_ref/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ use clap::{Parser, Args, Subcommand, ArgEnum};
struct Cli {
/// Doc comment
#[clap(ARG ATTRIBUTE)]
field: Type,
field: UserType,

#[clap(arg_enum, ARG ATTRIBUTE...)]
field: EnumValues,

#[clap(flatten)]
delegate: Struct,
Expand All @@ -43,7 +46,7 @@ struct Cli {
struct Struct {
/// Doc comment
#[clap(ARG ATTRIBUTE)]
field: Type,
field: UserType,
}

/// Doc comment
Expand All @@ -59,14 +62,14 @@ enum Command {
Variant2 {
/// Doc comment
#[clap(ARG ATTRIBUTE)]
field: Type,
field: UserType,
}
}

/// Doc comment
#[derive(ArgEnum)]
#[clap(ARG ENUM ATTRIBUTE)]
enum Mode {
enum EnumValues {
/// Doc comment
#[clap(POSSIBLE VALUE ATTRIBUTE)]
Variant1,
Expand Down

0 comments on commit d411e7a

Please sign in to comment.