summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Bruhin <git@the-compiler.org>2014-01-07 13:13:37 +0100
committerFlorian Bruhin <git@the-compiler.org>2014-01-07 13:13:37 +0100
commit29c16774f95c31ca2cacb0d5a240b54b635d3129 (patch)
tree617e468e3c4f422cdfa6e58eb9172aa5f679ba4e
parent00a15a49af9e42f388cbac07ee0a0f88af59856a (diff)
parent63b95a6aba5e2b4bf3162e7cff9ce85af2ddc2a6 (diff)
downloadnewrepo-29c16774f95c31ca2cacb0d5a240b54b635d3129.tar.gz
newrepo-29c16774f95c31ca2cacb0d5a240b54b635d3129.zip
Merge branch 'master' of ssh://git/newrepo
-rwxr-xr-xnewrepo.sh34
1 files changed, 29 insertions, 5 deletions
diff --git a/newrepo.sh b/newrepo.sh
index a6f7308..bb248eb 100755
--- a/newrepo.sh
+++ b/newrepo.sh
@@ -7,23 +7,47 @@ die() {
exit 1
}
-server=git@the-compiler.org
trap '[[ -d "$tmp" ]] && rm -rf "$tmp"' EXIT
+while :; do
+ case $1 in
+ --server)
+ opt_server="$2"
+ shift 2
+ ;;
+ --private)
+ opt_private=yes
+ shift
+ ;;
+ --name)
+ opt_name="$2"
+ shift 2
+ ;;
+ *)
+ break
+ ;;
+ esac
+done
+
top=$(git rev-parse --show-toplevel)
-name=${top##*/}
-if [[ "$1" == --private ]]; then
+server=${opt_server:-git@the-compiler.org}
+if [[ "$opt_name" ]]; then
+ name="$opt_name"
+else
+ name=${top##*/}
+fi
+
+if [[ "$opt_private" ]]; then
user="@private"
- shift
else
user="@public"
fi
desc="$1"
-[[ -z "$desc" ]] && die "Usage: $0 [--private] <description>"
+[[ -z "$desc" ]] && die "Usage: $0 [--private] [--server <server>] [--name <name>] <description>"
tmp=$(mktemp -d)
cd "$tmp"