diff options
author | Axel Beckert <abe@deuxchevaux.org> | 2015-11-25 18:51:00 +0100 |
---|---|---|
committer | Axel Beckert <abe@deuxchevaux.org> | 2015-11-25 18:51:00 +0100 |
commit | 317ec32cb1cbd15b31e17bcb07f09c52cd37c44a (patch) | |
tree | 88a02c853dfafd82a2d551d862d8dfb056b1bee6 /Completion/Redhat/Command/_scl | |
parent | 1637291aaea12ddcfd549d50d49c480185995c1a (diff) | |
parent | cce4261a3c6f4bf78b483db61623c80e3c98d10b (diff) | |
download | zsh-317ec32cb1cbd15b31e17bcb07f09c52cd37c44a.tar.gz zsh-317ec32cb1cbd15b31e17bcb07f09c52cd37c44a.zip |
Merge tag 'zsh-5.1.1-test-1' into debian
Diffstat (limited to 'Completion/Redhat/Command/_scl')
-rw-r--r-- | Completion/Redhat/Command/_scl | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Completion/Redhat/Command/_scl b/Completion/Redhat/Command/_scl new file mode 100644 index 000000000..e1a4b69db --- /dev/null +++ b/Completion/Redhat/Command/_scl @@ -0,0 +1,38 @@ +#compdef scl + +local curcontext="$curcontext" dashes ret=1 +local -a state line force alts cmd + +[[ $words[2] = deregister ]] && + force=( '--force[deregister even SCL installed as packages]' ) + +_arguments -C $force \ + '(- 1)'{-l,--list}'[list installed software collections or packages within a collection]' \ + '(-l --list)1:action:(enable register deregister)' \ + '(-)*:collections:->collections' && ret=0 + +if [[ -n $state ]]; then + (( $#line > 1 )) && curcontext="${curcontext%:*}-$line[1]:" + if [[ $line[1] = register ]]; then + _directories -P / -W / + return + fi + if (( ${dashes:=$words[(I)--]} )); then + shift dashes words + (( CURRENT -= dashes )) + _normal + return + fi + if [[ $CURRENT -gt 3 && $words[CURRENT] = - ]]; then + compadd - -- + return + fi + [[ $line[1] = enable && $CURRENT -gt 3 ]] && + cmd='command:command:_cmdstring' + + _alternative 'collections:collection:compadd + $(_call_program collections ${words[1]} -l)' \ + $cmd && ret=0 +fi + +return ret |