These are chat archives for kbknapp/clap-rs

28th
Jun 2015
Severen Redwood
@severen
Jun 28 2015 04:14
let _ = App::new("apex")
                  .about("A package manager for Arch Linux and the AUR")
                  .author("@SShrike <severen.redwood@gmail.com>")
                  .version("0.1.0")
                  .help("I should override the generated help text!")
                  .subcommand_required_else_help(true)
                  .subcommands(vec![
                      SubCommand::new("install")
                          .about("test")
                  ])
                  .get_matches();
So it should work like this?
Looking through the documentation there isn't even a .help() method defined for the clap::App struct.
Severen Redwood
@severen
Jun 28 2015 04:27
Don't be afraid to tell me if I'm being stupid btw :)
Severen Redwood
@severen
Jun 28 2015 04:53

To further clarify I am looking for help formatting like this:


A package manager for Arch Linux and the AUR

Usage:
apex <command> [<args>...]
apex [options]

Options:
-h, --help :: Display this message
-V, --version :: Print version info and exit
-v, --verbose :: Use verbose output

Some command Apex commands are:
install :: Install a package
uninstall :: Uninstall a package
sync :: Synchronise the package the databases

See 'apex help <command>' for more information on a specific command.


So like I said before basically the same format as Cargo.

Kevin K.
@kbknapp
Jun 28 2015 09:42
Oh wow, that must have been one I thought I implemented but I guess I haven't yet
😜
I'm on vacation these next two days, but I'll add it for real this time as soon as I get back, and its a real quick and easy thing to add.
The closest you can get in the mean time is:
Kevin K.
@kbknapp
Jun 28 2015 09:53
.usage("apex <command> [<args>...]\n
apex [options]")
.after_help("See 'apex help <command>' for more information on a specific command")
The commands don't need to be listed with what they do, because they get listed in the normal help message (using .about() for each subcommand)