-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathge
executable file
·75 lines (68 loc) · 1.17 KB
/
ge
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#!/bin/bash
current_dir=`pwd`
base_dir=`dirname $0`
function get_current_branch() {
git branch | grep '*' | awk '{print $2}'
}
function print_usage() {
echo "# ge: Git Extensions"
echo "# Simplify commonly used Git commands with intelligent assumptions"
echo "#"
echo "# Usage: ge <command> [arguments]"
echo "#"
echo "# Available commands:"
echo "# branch"
echo "# help"
echo "# ls"
echo "# review"
echo "# svn"
echo "# "
echo "# Show help for a specific command:"
echo "# ge help <command>"
}
function print_help() {
if [ -z "$1" ]; then
print_usage
elif [ "$1" = "current_branch" ]; then
echo "ge current_branch: Displays the currently checked out branch."
elif [ -f "$base_dir/ge-$1" ]; then
$base_dir/ge-$1 --help
else
print_usage
fi
}
if [ -z "$1" ]
then
print_usage
exit 0
fi
case $1 in
'branch')
shift
$base_dir/ge-branch $@
;;
'current_branch')
get_current_branch
;;
'ls')
shift
$base_dir/ge-ls $@
;;
'review')
shift
$base_dir/ge-review $@
;;
'svn')
shift
$base_dir/ge-svn $@
;;
'help')
shift
print_help "$1"
;;
*)
shift
print_help
;;
esac
exit 0