kward / shflags

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

Exit with FALSE handling 'help' argument. #37

Closed wrymarki closed 8 years ago

wrymarki commented 8 years ago

'help' argument is a special case arg intended just to print help message and exit the script. Therefore, you have to return FLAGS_FALSE and propagate this to the user to give a chance to stop the script.

Typicall usage of shflags is like below

FLAGS "$@" || exit $?

and it should do the job to exit script on '--help' as expected.

Signed-off-by: Waldemar Rymarkiewicz waldemar.rymarkiewicz@gmail.com