command
command copied to clipboard
Pr upstream
This PR provides improvements to the original code:
- help.Usage:
- This is necessary to match the behaviour of common
Unix usage where programs can take:
prog -h, prog --help, prog help, prog -help, prog --h
. Otherwise fla.Parse exits upon encountering -h, could define flag.Usage but we need to maintain the behaviour or passing arguments to the help function.
- This is necessary to match the behaviour of common
Unix usage where programs can take:
- stdout is now the outfile descriptor instead of stderr:
This is allow for users to pipe content into filters as well as to search for strings e.g using grep
<a_prog_using_command> -h | grep -i keyword [keywords....]
- help: stable sort order for subcommands: Makes the program help output more familiar and more easily indexed without minimal differences in case it changes, otherwise everytime there will be changes.