Clap has an app setting (SubcommandRequiredElseHelp) to handle applications that require a subcommand present to run. This commit enables that setting.
This changes the output of when atm is run without a subcommand:
Before change:
thread 'main' panicked at 'Did not receive directive', src/cli.rs:133:21
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
After change:
atm 0.2.0
All The Music, LLC
Tools for generating and working with MIDI files. This app was created as part of an effort to generate by brute-force
billions of melodies, and is tailored for that use case.
USAGE:
atm <SUBCOMMAND>
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
SUBCOMMANDS:
batch Generate by brute-force MIDI files containing permutations of a sequence of MIDI pitches
help Prints this message or the help of the given subcommand(s)
partition Generate the output path from the 'batch' directive for a given MIDI pitch sequence
single Generate single MIDI file from provided MIDI pitch sequence
An alternative would be using the SubcommandRequired option, which would change the output to:
error: 'atm' requires a subcommand, but one was not provided
USAGE:
atm <SUBCOMMAND>
For more information try --help
Although I believe outputting the help message to be the better option in this case.
Clap has an app setting (
SubcommandRequiredElseHelp
) to handle applications that require a subcommand present to run. This commit enables that setting.This changes the output of when
atm
is run without a subcommand: Before change:After change:
An alternative would be using the
SubcommandRequired
option, which would change the output to:Although I believe outputting the help message to be the better option in this case.