I am using the rust Clap library to parse command line arguments. When displaying my help text I want to separate required arguments from optional arguments and put them under separate headings. Something along the lines of this:
HELP:
Example header 1:
Arg 1
Arg 2
Example header 2:
Arg 3
Arg 4
Is this possible.
After reading this, this and this I think it might be but I am not confident of how to go about doing so.
EDIT:
So a commentor has asked me to update the post with some desired output so below is an example from one of the links above. I would like to be able to have two options sections and name them.
$ myprog --help
My Super Program 1.0
Kevin K. <kbknapp@gmail.com>
Does awesome things
USAGE:
MyApp [FLAGS] [OPTIONS] <INPUT> [SUBCOMMAND]
FLAGS:
-h, --help Prints this message
-v Sets the level of verbosity
-V, --version Prints version information
OPTIONS:
-c, --config <FILE> Sets a custom config file
ARGS:
INPUT The input file to use
SUBCOMMANDS:
help Prints this message
test Controls testing features
So changing the OPTIONS section above to be:
OPTIONS-1:
-c, --config <FILE> Sets a custom config file.
OPTIONS-2:
-a, --another <FILE> Another example command.