aboutsummaryrefslogtreecommitdiff
path: root/source/1.0/src/shflags
diff options
context:
space:
mode:
authorkate.ward <kate.ward@forestent.com>2008-11-13 00:42:43 +0000
committerkate.ward <kate.ward@forestent.com>2008-11-13 00:42:43 +0000
commit5b48fc1ae0b7dc7d8edeaa8bb544f321794d9681 (patch)
treeef0c28e500546b6ae47919fb65353c7ef757bb4e /source/1.0/src/shflags
parente556cbf61eb41fdf96d70da51d38982d9c71af4f (diff)
downloadshflags-5b48fc1ae0b7dc7d8edeaa8bb544f321794d9681.tar.gz
issue# 2 : --nohelp flag no longer produces help output
Diffstat (limited to 'source/1.0/src/shflags')
-rw-r--r--source/1.0/src/shflags21
1 files changed, 11 insertions, 10 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags
index 1b93072..f51bb91 100644
--- a/source/1.0/src/shflags
+++ b/source/1.0/src/shflags
@@ -227,8 +227,7 @@ _flags_define()
-a ${__FLAGS_GETOPT_VERS} -ne ${__FLAGS_GETOPT_VERS_ENH} \
-a "${_flags_short_}" = "${__FLAGS_NULL}" ]
then
- flags_error="getopt on this platform supports only short flags. Please \
-declare one for the (${_flags_name_}) flag."
+ flags_error="short flag required for (${_flags_name_}) on this platform"
_flags_return_=${FLAGS_ERROR}
fi
@@ -630,14 +629,6 @@ _flags_parseGetopt()
break
fi
- # handle special case help flag
- if [ "${_flags_name_}" = 'help' ]; then
- flags_help
- flags_error='help requested'
- flags_return=${FLAGS_FALSE}
- break
- fi
-
# set new flag value
[ ${_flags_type_} -eq ${__FLAGS_TYPE_NONE} ] && \
_flags_type_=`_flags_getFlagInfo \
@@ -687,6 +678,16 @@ _flags_parseGetopt()
;;
esac
+ # handle special case help flag
+ if [ "${_flags_name_}" = 'help' ]; then
+ if [ ${FLAGS_help} -eq ${FLAGS_TRUE} ]; then
+ flags_help
+ flags_error='help requested'
+ flags_return=${FLAGS_FALSE}
+ break
+ fi
+ fi
+
# shift the option out
shift
FLAGS_ARGC=`expr ${FLAGS_ARGC} + 1`