aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-30 07:04:14 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2017-03-30 07:04:14 +0000
commit357420e1904f2ec3213478dfe9d6a73045372ad4 (patch)
treeabb2fc8873a044d122f12f3054728971d45959b0 /tool
parent36bb50e06cee5ea5ed56a924ed08397dbe97473c (diff)
downloadruby-357420e1904f2ec3213478dfe9d6a73045372ad4.tar.gz
git-refresh: rewrite options
* tool/git-refresh: parse options without git-rev-parse, which is old on travis. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-xtool/git-refresh19
1 files changed, 6 insertions, 13 deletions
diff --git a/tool/git-refresh b/tool/git-refresh
index 7f5361a853..e3aa1b0970 100755
--- a/tool/git-refresh
+++ b/tool/git-refresh
@@ -3,24 +3,17 @@ set -e
quiet=
branch=
-OPT_SPEC="\
-${0##*/} [options] URL dir [options]
---
-C=directory Change directory
-q,quiet Quiet
-b,branch=branch Checkout branch
-"
-rev="$(echo "$OPT_SPEC" | git rev-parse --parseopt -- "$@")"
-status=$?
-eval "$rev"
-[ $status = 0 ] || exit $status
until [ $# = 0 ]; do
case "$1" in
--) shift; break;;
- -C) shift; cd "$1";;
+ -C|--directory) shift; cd "$1";;
+ -C*) cd "${1#-C}";;
+ --directory=*) cd "${1#*=}";;
-q) quiet=1;;
- -b) shift; branch="$1";;
+ -b|--branch) shift; branch="$1";;
+ -b*) branch="${1#-b}";;
+ --branch=*) branch="${1#*=}";;
-*) echo "unknown option: $1" 1>&2; exit 1;;
*) break;;
esac