forked from tj/git-extras
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbash_completion.sh
70 lines (55 loc) · 1 KB
/
bash_completion.sh
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
# bash completion support for git-extras.
_git_bug(){
__git_extras_workflow "bug"
}
_git_changelog(){
__gitcomp "--list"
}
_git_contrib(){
__gitcomp "$(git shortlog -s | cut -f2)" # TODO buggy if author's name contains whitespaces :(
}
_git_count(){
__gitcomp "--all"
}
_git_delete_branch(){
__gitcomp "$(__git_heads)"
}
_git_delete_submodule(){
__gitcomp "$(git submodule status | awk '{print $2}')"
}
_git_delete_tag(){
__gitcomp "$(__git_tags)"
}
_git_extras(){
__gitcomp "--version update"
}
__git_extras_workflow(){
__gitcomp "$(__git_heads | grep ^$1/ | sed s/^$1\\///g) finish"
}
_git_feature(){
__git_extras_workflow "feature"
}
_git_graft(){
__gitcomp "$(__git_heads)"
}
_git_ignore(){
case "$cur" in
--*)
__gitcomp "--global --local"
return
;;
-*)
__gitcomp "--global --local -g -l"
return
;;
esac
}
_git_refactor(){
__git_extras_workflow "refactor"
}
_git_squash(){
__gitcomp "$(__git_heads)"
}
_git_undo(){
__gitcomp "--hard --soft -h -s"
}