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

Don't suggest completions for git fork free-text arguments

The --remote-name and --org parameters to git fork expect arguments
which can be considered free text because the user has to suggest a
name, so we can't provide suggestions there.

If one of those two was the previous word then we clear completion
suggestions until a free-text word has been entered, allowing the user
to add their own input there.
上级 1a4bd7b9
......@@ -218,19 +218,30 @@ EOF
esac
}
# hub fork [--no-remote] [--remote-name] [--org]
# hub fork [--no-remote] [--remote-name REMOTE] [--org ORGANIZATION]
_git_fork() {
local i c=2 flags="--no-remote --remote-name --org"
while [ $c -lt $cword ]; do
i="${words[c]}"
case "$i" in
--no-remote|--remote-name|--org)
--remote-name|--org)
((c++))
flags=${flags/$i/}
;;
--no-remote)
flags=${flags/$i/}
;;
esac
((c++))
done
__gitcomp "$flags"
case "$prev" in
--remote-name|--org)
COMPREPLY=()
;;
*)
__gitcomp "$flags"
;;
esac
}
# 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.
先完成此消息的编辑!
想要评论请 注册