Skip to content

Instantly share code, notes, and snippets.

Created May 29, 2011 09:20
Show Gist options
  • Select an option

  • Save anonymous/3b08c44dfd585abccf47 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/3b08c44dfd585abccf47 to your computer and use it in GitHub Desktop.
ac_cs_version=1
opt_port=3128
opt_sleep=30
while test $# != 0
do
case $1 in
--*=*)
ac_option=`expr "X$1" : 'X\([^=]*\)='`
ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
ac_shift=:
;;
--*)
ac_option=$1
ac_optarg=$2
ac_shift=shift
;;
*)
break
;;
esac
case $ac_option in
# Handling of the options.
--version | -V )
echo "$ac_cs_version"; exit ;;
--port )
$ac_shift
opt_port="$ac_optarg"
;;
--sleep )
$ac_shift
opt_sleep="$ac_optarg"
;;
--*) { echo "$0: error: unrecognized option: $1
Try \`$0 --help' for more information." >&2
{ (exit 1); exit 1; }; } ;;
esac
shift
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment