zsh-workers
 help / color / mirror / code / Atom feed
b7bba2b13deb5403357eeb3f3b036a486e63b3fa blob 1110 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
 
#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 run load unload list-collections list-packages man register deregister)' \
  '(- *)--help' \
  '(-)*: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]} list-collections || ${words[1]} -l")' \
      $cmd && ret=0
fi

return ret
debug log:

solving b7bba2b ...
found b7bba2b in https://git.vuxu.org/mirror/zsh/

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).