Pārlūkot izejas kodu

Add death routines to git sibling

Alois Mahdal 11 gadus atpakaļ
vecāks
revīzija
222e0c574c
1 mainītis faili ar 11 papildinājumiem un 0 dzēšanām
  1. 11
    0
      dotfiles/gittum/bin/sibling

+ 11
- 0
dotfiles/gittum/bin/sibling Parādīt failu

@@ -33,6 +33,16 @@ sibling_conf=".gittum-sibling"
33 33
 ## funz
34 34
 #
35 35
 
36
+die() {
37
+    echo "$@" 1>&2
38
+    exit 1
39
+}
40
+
41
+usage() {
42
+    echo "usage: git $(basename $0) NEWPROJ [TEMPLATE]"
43
+    exit 0
44
+}
45
+
36 46
 rewrite_uri_to () {
37 47
     # create a new remote URI based on current one
38 48
     git remote -v \
@@ -48,6 +58,7 @@ rewrite_uri_to () {
48 58
 #
49 59
 
50 60
 project=$1
61
+test -n "$project" || usage
51 62
 
52 63
 if [ -f $sibling_conf ];
53 64
 then