Merge pull request #140 from peteryates/master

Added completion for Ralio
This commit is contained in:
Julien Nicoulaud 2013-05-26 02:29:26 -07:00
commit 0a46b6d482
1 changed files with 115 additions and 0 deletions

115
src/_ralio Normal file
View File

@ -0,0 +1,115 @@
#compdef ralio
# ZSH completion for ralio
#
# https://github.com/oesmith/ralio
#
# Author
#
# Peter Yates
_ralio ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options' \
case $state in
(command)
local -a subcommands
subcommands=(
"backlog:Show the product backlog"
"sprint:Show the current team iteration"
"show:Show related information for an individual story, defect or task"
"open:Open a story, defect or task in a web browser"
"start:Set a task, defect or story state to in-progress and assign it to you"
"finish:Set a task, defect or story state to completed and assign it to you"
"abandon:Set a task, defect or story state to defined and clear the owner"
"block:Set a task, defect or story state to blocked"
"unblock:Set a task, defect or story state to unblocked"
"current:Show your current tasks and stories"
"point:Set the points for a story or defect"
"task:Allow you to create and delete story tasks."
"configure:Set your Rally configurations."
)
_describe -t commands 'ralio commands' subcommands
_arguments -C \
{-V,--version}"[display version information]" \
{-h,--help}"[output usage information]"
;;
(options)
case $line[1] in
(sprint)
_arguments \
"-t[Show tasks]" \
"-p[Project name]" \
"-f[Filter results]"
;;
(start | finish)
_arguments \
'--pair[Pair programming partner]' \
"--resolution[Resolution status]" \
"--rootcause[Root cause]"
;;
(task)
__ralio-task
;;
esac
;;
esac
}
__ralio-task ()
{
local curcontext="$curcontext" state line
typeset -A opt_args
_arguments -C \
':command:->command' \
'*::options:->options'
case $state in
(command)
local -a subcommands
subcommands=(
"create:Create a new task"
"delete:Delete a task"
)
_describe -t commands 'ralio task' subcommands
;;
(options)
case $line[1] in
(create|delete)
_arguments \
-n"[Name of the new task]" \
-t"[Name of the parent task]"
;;
esac
;;
esac
}
_ralio "$@"
# Local Variables:
# mode: Shell-Script
# sh-indentation: 2
# indent-tabs-mode: nil
# sh-basic-offset: 2
# End:
# vim: ft=zsh sw=2 ts=2 et