projects
/
awesomized
/
libmemcached
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
|
github
raw
|
patch
|
inline
| side by side (parent:
1f3d431
)
OSX lacks getopt long support :(
author
Brian Aker
<brian@tangent.org>
Fri, 19 Oct 2012 02:41:39 +0000
(22:41 -0400)
committer
Brian Aker
<brian@tangent.org>
Fri, 19 Oct 2012 02:41:39 +0000
(22:41 -0400)
bootstrap.sh
patch
|
blob
|
history
diff --git
a/bootstrap.sh
b/bootstrap.sh
index 13d10b39f10c86d22daa42fb45ce1e7b72c50686..c46f1eaf524ad0c517f19e7109c8290a9b2a3551 100755
(executable)
--- a/
bootstrap.sh
+++ b/
bootstrap.sh
@@
-698,65
+698,45
@@
run ()
parse_command_line_options ()
{
parse_command_line_options ()
{
- local
options=
+ local
SHORTOPTS=':apcmt:dv'
- local SHORTOPTS='p,c,a,v'
- local LONGOPTS='target:,debug,clean,print-env,configure,autoreconf'
-
- if ! options=$(getopt --shell bash --longoptions $LONGOPTS --options $SHORTOPTS -n 'bootstrap' -- "$@"); then
- die 'Bad option given'
- fi
-
- eval set -- "$options"
-
- while [[ $# -gt 0 ]]; do
- case $1 in
- -a | --autoreconf )
+ while getopts "$SHORTOPTS" opt; do
+ case $opt in
+ a) #--autoreconf
AUTORECONF_OPTION=true
MAKE_TARGET='autoreconf'
AUTORECONF_OPTION=true
MAKE_TARGET='autoreconf'
- shift
;;
;;
- -p | --print-env )
+ p) #--print-env
PRINT_SETUP_OPTION=true
PRINT_SETUP_OPTION=true
- shift
;;
;;
- -c | --configure )
+ c) # --configure
CONFIGURE_OPTION=true
MAKE_TARGET='configure'
CONFIGURE_OPTION=true
MAKE_TARGET='configure'
- shift
;;
;;
- --clean )
+ m) # maintainer-clean
CLEAN_OPTION=true
MAKE_TARGET='clean_op'
CLEAN_OPTION=true
MAKE_TARGET='clean_op'
- shift
;;
;;
- --target )
+ t) # target
TARGET_OPTION=true
TARGET_OPTION=true
- shift
- TARGET_OPTION_ARG="$1"
- MAKE_TARGET="$1"
- shift
+ TARGET_OPTION_ARG="$OPTARG"
+ MAKE_TARGET="$OPTARG"
;;
;;
- --debug )
+ d) # debug
DEBUG_OPTION=true
enable_debug
DEBUG_OPTION=true
enable_debug
- shift
;;
;;
- -v | --verbose )
+ v) # verbose
VERBOSE_OPTION=true
VERBOSE=true
VERBOSE_OPTION=true
VERBOSE=true
- shift
;;
;;
- -- )
- shift
- break
- ;;
- -* )
- echo "$0: error - unrecognized option $1" 1>&2
+ :)
+ echo "Option -$OPTARG requires an argument." >&2
exit 1
;;
*)
exit 1
;;
*)
- break
+ echo "$0: error - unrecognized option $1" 1>&2
+ exit 1
;;
esac
done
;;
esac
done