kward / shflags

shFlags is a port of the Google gflags library for Unix shell.
Apache License 2.0
283 stars 45 forks source link

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

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 butko...@gmail.com on 8 Jul 2013 at 9:30