Permalink
Browse files

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.
  • Loading branch information...
nvie committed Feb 3, 2011
1 parent 553776f commit f1eaa4e0d05a1edc1023a1922c7cc5e2d5bcb546
Showing with 3 additions and 11 deletions.
  1. +1 −1 git-flow-feature
  2. +1 −1 git-flow-hotfix
  3. +1 −1 git-flow-release
  4. +0 −8 gitflow-common
View
@@ -180,7 +180,7 @@ parse_args() {
parse_cmdline "$@"
# read arguments into global variables
- NAME=$(last_arg "$@")
+ NAME=$1
BRANCH=$PREFIX$NAME
}
View
@@ -124,7 +124,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
- VERSION=$(last_arg "$@")
+ VERSION=$1
BRANCH=$PREFIX$VERSION
}
View
@@ -121,7 +121,7 @@ parse_args() {
eval set -- "${FLAGS_ARGV}"
# read arguments into global variables
- VERSION=$(last_arg "$@")
+ VERSION=$1
BRANCH=$PREFIX$VERSION
}
View
@@ -44,14 +44,6 @@
warn() { echo "$@" >&2; }
die() { warn "$@"; exit 1; }
-# argument processing
-last_arg() {
- if [ $# -ne 0 ]; then
- shift $(expr $# - 1)
- echo "$1"
- fi
-}
-
# set logic
has() {
local item=$1; shift

0 comments on commit f1eaa4e

Please sign in to comment.