aboutsummaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorkate.ward <kate.ward@forestent.com>2012-12-17 23:34:29 +0000
committerkate.ward <kate.ward@forestent.com>2012-12-17 23:34:29 +0000
commit4ae73d81dbe35e1d6e7d5f6a9b0fbe8fbd59b49f (patch)
tree33eda75836b091c209e21e10f04d7a02805f72f8 /source
parenta589b9ff1c40b00f6c96314f813d7e2c47d7ae4b (diff)
downloadshflags-4ae73d81dbe35e1d6e7d5f6a9b0fbe8fbd59b49f.tar.gz
allow users to override the FLAGS_EXPR_CMD variable
Diffstat (limited to 'source')
-rw-r--r--source/1.0/src/shflags16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/1.0/src/shflags b/source/1.0/src/shflags
index 9a61d7a..4177ac9 100644
--- a/source/1.0/src/shflags
+++ b/source/1.0/src/shflags
@@ -87,16 +87,16 @@
[ -n "${FLAGS_VERSION:-}" ] && return 0
FLAGS_VERSION='1.0.4pre'
-FLAGS_UNAME_S=`uname -s`
-
-# Different OSes need different commands.
-case "${FLAGS_UNAME_S}" in
- BSD) FLAGS_EXPR_CMD='gexpr' ;;
- *) FLAGS_EXPR_CMD='expr' ;;
+# Set some reasonable defaults.
+__FLAGS_UNAME_S=`uname -s`
+case "${__FLAGS_UNAME_S}" in
+ BSD) __FLAGS_EXPR_CMD='gexpr' ;;
+ *) __FLAGS_EXPR_CMD='expr' ;;
esac
-# A user can set the path to a different getopt command by overriding this
-# variable in their script.
+# A user can set the path to different commands by overriding these variables in
+# their script.
+FLAGS_EXPR_CMD=${FLAGS_EXPR_CMD:-${__FLAGS_EXPR_CMD}}
FLAGS_GETOPT_CMD=${FLAGS_GETOPT_CMD:-getopt}
# return values that scripts can use