Commit f1eaa4e0 authored by Vincent Driessen's avatar Vincent Driessen

Don't just take the last argument, take the first.

This patch was originally contributed as a workaround for the cases
where there were flags that took the first argument position.  This fix
was just plain wrong and this commit reverts it.
parent 553776fd
...@@ -180,7 +180,7 @@ parse_args() { ...@@ -180,7 +180,7 @@ parse_args() {
parse_cmdline "$@" parse_cmdline "$@"
# read arguments into global variables # read arguments into global variables
NAME=$(last_arg "$@") NAME=$1
BRANCH=$PREFIX$NAME BRANCH=$PREFIX$NAME
} }
......
...@@ -124,7 +124,7 @@ parse_args() { ...@@ -124,7 +124,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}" eval set -- "${FLAGS_ARGV}"
# read arguments into global variables # read arguments into global variables
VERSION=$(last_arg "$@") VERSION=$1
BRANCH=$PREFIX$VERSION BRANCH=$PREFIX$VERSION
} }
......
...@@ -121,7 +121,7 @@ parse_args() { ...@@ -121,7 +121,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}" eval set -- "${FLAGS_ARGV}"
# read arguments into global variables # read arguments into global variables
VERSION=$(last_arg "$@") VERSION=$1
BRANCH=$PREFIX$VERSION BRANCH=$PREFIX$VERSION
} }
......
...@@ -44,14 +44,6 @@ ...@@ -44,14 +44,6 @@
warn() { echo "$@" >&2; } warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; } die() { warn "$@"; exit 1; }
# argument processing
last_arg() {
if [ $# -ne 0 ]; then
shift $(expr $# - 1)
echo "$1"
fi
}
# set logic # set logic
has() { has() {
local item=$1; shift local item=$1; shift
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment