From 4e117ea0ddff44bfe26495af459f5befaf6cdd77 Mon Sep 17 00:00:00 2001 From: Julien Nicoulaud Date: Fri, 2 Sep 2011 15:43:22 +0200 Subject: [PATCH] #23 github: complete 'network' command --- _github | 45 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/_github b/_github index 00acb65..e4e36a7 100644 --- a/_github +++ b/_github @@ -107,14 +107,14 @@ _github() { && ret=0 ;; (issues) - _arguments \ - '1:cmd:->cmds' \ + _arguments -C \ + '1:issue-status:->issue-statuses' \ '2:: :_github_users' \ '--after[only show issues updated after a certain date]:date' \ '--label[only show issues with a certain label]:label' \ && ret=0 case "$state" in - (cmds) + (issue-statuses) local statuses; statuses=( 'open:show open issues' 'closed:show closed issues' @@ -124,8 +124,43 @@ _github() { esac ;; (network) - # TODO Not implemented - _message "${words[1]} command argument" && ret=0 + _arguments -C \ + '1:network-subcommand:->network-subcommands' \ + '*::network-arg:->network-args' \ + '(--after)--before[only show commits before a certain date]:date' \ + '(--before)--after[only show commits after a certain date]:date' \ + '--applies[filter commits to patches that apply cleanly]' \ + '--author[filter commits on a email address of author]:author' \ + '--cache[use the network data even if it'\''s expired]' \ + '--common[show common branch point]' \ + '--limit[only look through the first X heads - useful for really large projects]:number' \ + '--noapply[filter commits to patches that do not apply cleanly]' \ + '--nocache[do not use the cached network data]' \ + '--project[filter commits on a certain project]:project' \ + '--shas[only show shas]' \ + '--sort[how to sort : date, branch, author]:sort type:((date\:sort\ by\ date\ \(default\) branch\:sort\ by\ branch author\:sort\ by\ author))' \ + '--thisbranch[look at branches that match the current one]' \ + && ret=0 + case "$state" in + (network-subcommands) + local subcommands; subcommands=( + 'web:open network in a web browser' + 'list:list network members' + 'fetch:fetch network members commits' + 'commits:list network members commits' + ) + _describe -t subcommands 'subcommand' subcommands && ret=0 + ;; + (network-args) + case $words[1] in + (web) + _arguments \ + '1: :_github_users' \ + && ret=0 + ;; + esac + ;; + esac ;; (open) # TODO Not implemented