shflags icon indicating copy to clipboard operation
shflags copied to clipboard

document in the wiki the way to show help for no flags/arguments present

Open GoogleCodeExporter opened this issue 10 years ago • 0 comments

it would be nice to include to wiki the way to print the help for example for 
the no flags/arguments present.

The way it worked for me on the sample program documented here: 
http://stackoverflow.com/questions/17521380/bash-showing-usage-help-on-no-argume
nts-with-shflags/17521842#17521842

was:
...
# parse the command-line
FLAGS "$@" || exit $?
if [ $# == 0 ] ; then
    flags_help
    exit 1;
fi
eval set -- "${FLAGS_ARGV}"
...

Original issue reported on code.google.com by [email protected] on 8 Jul 2013 at 9:30

GoogleCodeExporter avatar Jun 26 '15 04:06 GoogleCodeExporter