#23 github: complete 'fork' command

This commit is contained in:
Julien Nicoulaud 2011-09-02 14:58:44 +02:00
parent d38b8a2668
commit c501c18a2c
1 changed files with 15 additions and 2 deletions

17
_github
View File

@ -97,8 +97,9 @@ _github() {
&& ret=0
;;
(fork)
# TODO Not implemented
_message "${words[1]} command argument" && ret=0
_arguments \
'1: :_github_user_slash_repos' \
&& ret=0
;;
(home)
# TODO Not implemented
@ -161,4 +162,16 @@ _github_branches() {
_message -e branches 'branch'
}
(( $+functions[_github_user_slash_repos] )) ||
_github_user_slash_repos() {
local ret=1
if compset -P '*/'; then
# TODO Make it contextual to the user
_wanted repos expl 'repo' _github_repos && ret=0
else
_wanted users expl 'user' _github_users -qS/ && ret=0
fi
return ret
}
_github "$@"