提交 1cd31ae8 编写于 作者: S Siôn le Roux

Add --remote-name flag to bash completion for git fork

Instead of adding more if statements I swapped the remote=yes variable
for a list of available flags which we drop elements from on each
completion.  This is based on the logic in git create above.

Fixes #2108.
上级 6faa8a8b
......@@ -218,21 +218,19 @@ EOF
esac
}
# hub fork [--no-remote]
# hub fork [--no-remote] [--remote-name]
_git_fork() {
local i c=2 remote=yes
local i c=2 flags="--no-remote --remote-name"
while [ $c -lt $cword ]; do
i="${words[c]}"
case "$i" in
--no-remote)
unset remote
--no-remote|--remote-name)
flags=${flags/$i/}
;;
esac
((c++))
done
if [ -n "$remote" ]; then
__gitcomp "--no-remote"
fi
__gitcomp "$flags"
}
# hub pull-request [-f] [-m <MESSAGE>|-F <FILE>|-i <ISSUE>|<ISSUE-URL>] [-b <BASE>] [-h <HEAD>] [-a <USER>] [-M <MILESTONE>] [-l <LABELS>]
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册