diff options
author | kate.ward <kate.ward@forestent.com> | 2008-07-11 15:33:23 +0000 |
---|---|---|
committer | kate.ward <kate.ward@forestent.com> | 2008-07-11 15:33:23 +0000 |
commit | 1d0ecc466906f1db8c1f2fb5fff9b13f9b2f8ce2 (patch) | |
tree | 5ebc22ea5e46b8b51b48f94e8acfcdf766ddfc15 /source/1.0/src/shflags | |
parent | f32fb4ff4ecd173815fffd0473dfc20ceeae4d71 (diff) | |
download | shflags-1d0ecc466906f1db8c1f2fb5fff9b13f9b2f8ce2.tar.gz |
fixed problems with help; changed zsh checks
Diffstat (limited to 'source/1.0/src/shflags')
-rw-r--r-- | source/1.0/src/shflags | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags index 08216fc..0e34287 100644 --- a/source/1.0/src/shflags +++ b/source/1.0/src/shflags @@ -79,8 +79,9 @@ FLAGS_ERROR=2 # specific shell checks if [ -n "${ZSH_VERSION:-}" ]; then - if [ "`set -o |grep "^shwordsplit" |awk '{print $2}'`" = 'off' ]; then - _flags_fatal 'shwordsplit is required for proper operation' + setopt |grep "^shwordsplit$" >/dev/null + if [ $? -ne ${FLAGS_TRUE} ]; then + _flags_fatal 'zsh shwordsplit option is required for proper zsh operation' exit ${FLAGS_ERROR} fi if [ -z "${FLAGS_PARENT:-}" ]; then @@ -156,7 +157,10 @@ __FLAGS_TYPE_STRING=4 _flags_constants=`set |awk -F= '/^FLAGS_/ || /^__FLAGS_/ {print $1}'` for _flags_const in ${_flags_constants}; do if [ -n "${ZSH_VERSION:-}" ]; then - readonly -g ${_flags_const} # declare readonly constants globally + case ${ZSH_VERSION} in + [123].*) readonly ${_flags_const} ;; + *) readonly -g ${_flags_const} ;; # declare readonly constants globally + esac else readonly ${_flags_const} fi |