Permalink
Browse files

minimal help texts for git-{g,k,gk}

plus a little error handling
  • Loading branch information...
mcast committed Apr 19, 2012
1 parent 58105f6 commit eb7bfeff92fbea2f695ab8ab6d18408744ed4bcf
Showing with 53 additions and 2 deletions.
  1. +18 −0 bin/git-g
  2. +16 −1 bin/git-gk
  3. +19 −1 bin/git-k
View
@@ -1,3 +1,21 @@
#! /bin/sh
+if [ "$1" = '-h' ] || [ "$1" = "--help" ]; then
+ cat <<EOF
+Syntax: git g
+
+Shortcut to "git gui &"
+
+See also:
+ git k
+ git gk
+EOF
+ exit 0
+fi >&2
+
+if [ $# != 0 ]; then
+ echo 'git g: takes no arguments (yet)' >&2
+ exit 1
+fi
+
git gui &
View
@@ -1,9 +1,24 @@
#! /bin/sh
# Shortcut to open both Tk tools
+if [ "$1" = '-h' ] || [ "$1" = "--help" ]; then
+ cat <<EOF
+Syntax: git gk [ <workdir> ]
+
+Shortcut to run gitk (via git-k) and git-gui (via git-g),
+putting both in the background.
+
+If a workdir is given, attempt to cd there first.
+
+See also:
+ git g
+ git k
+EOF
+ exit 0
+fi >&2
if [ -n "$1" ]; then
- cd "$1"
+ cd "$1" || exit 2
echo -n "In "; pwd
shift
fi
View
@@ -1,6 +1,24 @@
#! /bin/sh
-# Shortcut to gitk to "show everything" - mst useful on small projects
+if [ "$1" = '-h' ] || [ "$1" = "--help" ]; then
+ cat <<EOF
+Syntax: git k
+
+Shortcut to gitk,
+ "show all heads" - most useful on small projects
+ put it in the background
+
+See also:
+ git g
+ git gk
+EOF
+ exit 0
+fi >&2
+
+if [ $# != 0 ]; then
+ echo 'git k: takes no arguments (yet)' >&2
+ exit 1
+fi
MORE=

0 comments on commit eb7bfef

Please sign in to comment.