aboutsummaryrefslogtreecommitdiff
path: root/source/1.0/src/shflags
diff options
context:
space:
mode:
authorkate.ward <kate.ward@forestent.com>2008-11-12 22:37:05 +0000
committerkate.ward <kate.ward@forestent.com>2008-11-12 22:37:05 +0000
commitabae05d8051c23fbca3e0e6c459142815df74a23 (patch)
tree2199e6430a8cb09cb881082fba57b1baec0ebc00 /source/1.0/src/shflags
parent1b600c53cdd5ad1b8a487d50ec1d1e9b0992166c (diff)
downloadshflags-abae05d8051c23fbca3e0e6c459142815df74a23.tar.gz
no more warning is thrown when the user defines their own help flag
Diffstat (limited to 'source/1.0/src/shflags')
-rw-r--r--source/1.0/src/shflags5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags
index 221ba51..eb7a9b7 100644
--- a/source/1.0/src/shflags
+++ b/source/1.0/src/shflags
@@ -735,8 +735,9 @@ DEFINE_string() { _flags_define ${__FLAGS_TYPE_STRING} "$@"; }
# integer: success of operation, or error
FLAGS()
{
- # define standard 'help' flag
- DEFINE_boolean 'help' false 'show this help' 'h'
+ # define a standard 'help' flag if one isn't already defined
+ [ -z "${__flags_help_type:-}" ] && \
+ DEFINE_boolean 'help' false 'show this help' 'h'
# parse options
# TODO(kward): look into '-T' option to test the internal getopt() version