/usr/share/bash-completion/completions/git-hub is in git-hub 1.0.0-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | __git_hub_get_issues()
{
git hub issue list 2> /dev/null |
sed -n 's/^\[\([0-9]\+\)\] .*$/\1/p' | tr '\n' ' '
}
__git_hub_get_pulls()
{
git hub pull list 2> /dev/null |
sed -n 's/^\[\([0-9]\+\)\] .*$/\1/p' | tr '\n' ' '
}
_git_hub ()
{
local subcommand="$(__git_find_on_cmdline "clone issue pull setup")"
if [ -z "$subcommand" ]; then
case "$cur" in
--*)
__gitcomp "--help --version --verbose --silent "
;;
*)
__gitcomp "clone issue pull setup"
;;
esac
else
case "$subcommand" in
clone)
local subsubcommand="$(__git_find_on_cmdline "")"
if [ -z "$subsubcommand" ]; then
case "$cur" in
--*)
__gitcomp "--help --triangular --no-triangular --upstreamremote= --forkremote= "
;;
*)
__gitcomp ""
;;
esac
else
case "$subsubcommand,$cur" in
*)
COMPREPLY=()
;;
esac
fi
;;
issue)
local subsubcommand="$(__git_find_on_cmdline "close comment list new show update")"
if [ -z "$subsubcommand" ]; then
case "$cur" in
--*)
__gitcomp "--help "
;;
*)
__gitcomp "close comment list new show update"
;;
esac
else
case "$subsubcommand,$cur" in
close,--*)
__gitcomp "--help --edit-message --message= "
;;
comment,--*)
__gitcomp "--help --message= "
;;
list,--*)
__gitcomp "--help --closed --created-by-me --assigned-to-me "
;;
new,--*)
__gitcomp "--help --message= --label= --assign= --milestone= "
;;
show,--*)
__gitcomp "--help --summary "
;;
update,--*)
__gitcomp "--help --edit-message --open --close --message= --label= --assign= --milestone= "
;;
*)
__gitcomp "$(__git_hub_get_issues)"
;;
esac
fi
;;
pull)
local subsubcommand="$(__git_find_on_cmdline "attach checkout close comment list new rebase show update")"
if [ -z "$subsubcommand" ]; then
case "$cur" in
--*)
__gitcomp "--help "
;;
*)
__gitcomp "attach checkout close comment list new rebase show update"
;;
esac
else
case "$subsubcommand,$cur" in
attach,--*)
__gitcomp "--help --edit-message --force-push --message= --base= --create-branch= "
;;
checkout,--*)
__gitcomp "--help "
;;
close,--*)
__gitcomp "--help --edit-message --message= "
;;
comment,--*)
__gitcomp "--help --message= "
;;
list,--*)
__gitcomp "--help --closed --created-by-me --assigned-to-me "
;;
new,--*)
__gitcomp "--help --force-push --message= --base= --create-branch= "
;;
rebase,--*)
__gitcomp "--help --continue --abort --skip --edit-message --force-push --pause --stash-all --delete-branch --message= "
;;
show,--*)
__gitcomp "--help --summary "
;;
update,--*)
__gitcomp "--help --edit-message --open --close --message= --label= --assign= --milestone= "
;;
*)
__gitcomp "$(__git_hub_get_pulls)"
;;
esac
fi
;;
setup)
local subsubcommand="$(__git_find_on_cmdline "")"
if [ -z "$subsubcommand" ]; then
case "$cur" in
--*)
__gitcomp "--help --global --system --username= --password= --baseurl= "
;;
*)
__gitcomp ""
;;
esac
else
case "$subsubcommand,$cur" in
*)
COMPREPLY=()
;;
esac
fi
;;
*)
COMPREPLY=()
;;
esac
fi
}
_xfunc git __git_complete git-hub _git_hub
|