Skip to content

what can I replace SubcommandRequiredElseHelp with? #3618

Answered by epage
igotfr asked this question in Q&A
Discussion options

You must be logged in to vote

Note that it is describing functions on Command which most likely will operate on an instance You can double check in the docs that these are chained methods, like version, giving you:

Command::new("sea-orm-cli")
        .version(env!("CARGO_PKG_VERSION"))
        .subcommand(entity_subcommand)
        .subcommand(migrate_subcommands)
        .arg(
            Arg::new("VERBOSE")
                .long("verbose")
                .short('v')
                .help("Show debug messages")
                .takes_value(false)
                .global(true),
        )
        .subcommand_required(true).arg_required_else_help(true);

Something else that can help is to search the repo for examples

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by igotfr
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants