-
-
Notifications
You must be signed in to change notification settings - Fork 35
/
git-fame_completion.bash
48 lines (48 loc) · 1.57 KB
/
git-fame_completion.bash
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
_git_fame()
{
local cur prv
cur="${COMP_WORDS[COMP_CWORD]}"
prv="${COMP_WORDS[COMP_CWORD-1]}"
case ${COMP_CWORD} in
1)
COMPREPLY=($(compgen -W "fame" "${cur}"))
;;
*)
case ${prv} in
--sort)
COMPREPLY=($(compgen -W 'loc commits files hours months' -- ${cur}))
;;
--cost)
COMPREPLY=($(compgen -W 'months cocomo hours commits' -- ${cur}))
;;
--loc)
COMPREPLY=($(compgen -W 'surviving insertions deletions' -- ${cur}))
;;
--format)
COMPREPLY=($(compgen -W 'pipe markdown yaml json csv tsv tabulate' -- ${cur}))
;;
--log)
COMPREPLY=($(compgen -W 'FATAL CRITICAL ERROR WARNING INFO DEBUG NOTSET' -- ${cur}))
;;
--branch)
COMPREPLY=($(compgen -W "$(git branch | sed 's/*/ /')" -- ${cur}))
;;
--ignore-revs-file)
COMPREPLY=($(compgen -f -- "${cur}"))
;;
--manpath)
COMPREPLY=($(compgen -d -- "${cur}"))
;;
--incl|--excl|--since|--ignore-rev|--until)
COMPREPLY=( )
;;
*)
if [ ${COMP_WORDS[1]} == fame ]; then
COMPREPLY=($(compgen -dW '-h --help -v --version --cost --branch --since --until --sort --loc --incl --excl -R --recurse -n --no-regex -s --silent-progress --warn-binary -t --bytype -w --ignore-whitespace -e --show-email --enum -M -C --ignore-rev --ignore-revs-file --format --manpath --log' -- ${cur}))
fi
;;
esac
;;
esac
}
complete -F _git_fame git-fame