#!/bin/sh
-# git-publish-branch [-d] <branch> [repository]
+# git-publish-branch [-d] [branch] [repository]
unset delete
if [ "$1" = "-d" ]; then
if [ $# -eq 1 ]; then
branch=$1
elif [ $# -eq 2 ]; then
- remote=$1
- branch=$2
+ branch=$1
+ remote=$2
elif [ $# -gt 2 ]; then
- echo "Usage: $0 [<repository>] <branch>" >&2
- exit 127
+ echo "Usage: $0 [branch] [repository]" >&2
+ exit 1
fi
if [ -z "$branch" ]; then