diff options
author | Daniel Friesel <derf@finalrewind.org> | 2011-08-16 19:50:30 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2011-08-16 19:50:30 +0200 |
commit | 36e217ea01204377aefacdf3e7c9a7b667cb3d00 (patch) | |
tree | 5bf92209490ff1650ba71443c3dc9cd8297dcd87 /etc | |
parent | 8f161a3188bd943e4ac96276843348b853993a1e (diff) |
Simplify _twidge
Diffstat (limited to 'etc')
-rw-r--r-- | etc/completions/_twidge | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/etc/completions/_twidge b/etc/completions/_twidge index 6309c55..3c128e4 100644 --- a/etc/completions/_twidge +++ b/etc/completions/_twidge @@ -47,7 +47,7 @@ function _twidge_args { ':status' ) - case $1 in + case ${words[1]} in lsarchive) _arguments $args_common $args_more $args_other ;; @@ -70,22 +70,11 @@ function _twidge_args { } function _twidge { - typeset -i ret=1 - typeset curcontext=$curcontext state line - typeset -A opt_args - - _arguments -C \ + _arguments \ '(-c --config)'{-c,--config}'[config file]:file:_files' \ '(-d --debug)'{-d,--debug}'[enable debugging output]' \ - '(-): :->command' \ - '(-)*:: :->command-argument' && return - - case $state in - command) _call_function ret _twidge_command ;; - command-argument) _call_function ret _twidge_args ${words[1]} ;; - esac - - return ret + '(-): :_twidge_command' \ + '(-)*:: :_twidge_args' } _twidge |