提交 5f5dd4c9 编写于 作者: S Siôn le Roux

Make --no-remote and --remote-name completions mutually exclusive

Because it wouldn't make sense to set a name for a remote when you ask
it not to add a remote (or vice versa) these two flags are mutually
exclusive.

For lack of an idea for a more elegant solution, I've made it so that
whenever either of them matches, the other will also be dropped from the
available flags list.  This works perfectly for now but will probably
need to be revisited if any other such parameters are added in future.
上级 1d209b89
......@@ -224,12 +224,18 @@ EOF
while [ $c -lt $cword ]; do
i="${words[c]}"
case "$i" in
--remote-name|--org)
--org)
((c++))
flags=${flags/$i/}
;;
--remote-name)
((c++))
flags=${flags/$i/}
flags=${flags/--no-remote/}
;;
--no-remote)
flags=${flags/$i/}
flags=${flags/--remote-name/}
;;
esac
((c++))
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册