Fix completion of rvm subcommands

Adapt parsing the output of `rvm help` to deal with new formatting of
the subcommand list:

command       :: description

While still handling the former format:

  command      -  description
This commit is contained in:
Aaron Schrab 2012-08-26 01:16:55 -04:00
parent ed52808629
commit 9027ad4101
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ case $state in
cmds)
cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | sed -e '/^== Action/,/^== Implementation/!d; / - /!d; s/^[ *]*\([^ ]*\) *\- *\(.*\)/\1:\2/')"} )
cmds=( ${(f)"$(_call_program commands rvm help 2> /dev/null | sed -e '/^== Action/,/^== Implementation/!d; / \(::\|-\) /!d; s/^[ *]*\([^ *]*\)[ *]*\(::\|-\) *\(.*\)/\1:\3/')"} )
cmds+=( $(rvm list strings) )
_describe -t commands 'rvm command' cmds && ret=0
;;