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
Is there any way to ignore or skip a variant in an enum being used as a subcommand?
#[derive(StructOpt)]structOpt{#[structopt(subcommand)]subcommand:Subcommand,}#[derive(StructOpt)]enumSubcommand{One{arg:u8},Two(arg:u8},// Don't make this available as a subcommand#[structopt(skip)]Three{ arg:u8},}
I've got a large enum that is both used as subcommands for a CLI interface as well as the data for network calls by serializing as JSON using serde_json. This has worked great and cut down on the need to duplicate the majority of the data - something I had to deal with quite often in the past - but there are a couple of variants that I'd like to ignore/skip.
The text was updated successfully, but these errors were encountered:
Is there any way to ignore or skip a variant in an enum being used as a subcommand?
I've got a large enum that is both used as subcommands for a CLI interface as well as the data for network calls by serializing as JSON using
serde_json
. This has worked great and cut down on the need to duplicate the majority of the data - something I had to deal with quite often in the past - but there are a couple of variants that I'd like to ignore/skip.The text was updated successfully, but these errors were encountered: