Thanks. I think you would need something like this on top if you want to really fix it, though. I also suspect that we should error out on: $ git tag -l foo bar but that will be left as an exercise to the readers ;-) diff --git a/git-tag.sh b/git-tag.sh index bc0d735..48b54a1 100755 --- a/git-tag.sh +++ b/git-tag.sh @@ -14,7 +14,8 @@ username= list= verify= LINES=0 -while [ $# -ne 0 ]; do +while case "$#" in 0) break ;; esac +do case "$1" in -a) annotate=1 @@ -30,8 +31,9 @@ while [ $# -ne 0 ]; do shift ;; -n) - case $2 in - -*) LINES=1 # no argument + case "$#,$2" in + 1,* | *,-*) + LINES=1 # no argument ;; *) shift LINES=$(expr "$1" : '\([0-9]*\)') @@ -43,7 +45,14 @@ while [ $# -ne 0 ]; do -l) list=1 shift - PATTERN="$1" # select tags by shell pattern, not re + case $# in + 0) PATTERN= + ;; + *) + PATTERN="$1" # select tags by shell pattern, not re + shift + ;; + esac git rev-parse --symbolic --tags | sort | while read TAG do - To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html