zsh-workers
 help / color / mirror / code / Atom feed
40389375c21c813fa2d4ab61b932295699721c91 blob 1923 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
40
41
42
43
44
45
46
47
48
49
50
51
52
 
#compdef debsnap

# Based on debsnap from devscripts-2.20.3

local context state state_descr line ret=1
local -a expl
typeset -A opt_args

_arguments \
  '(-d --destdir)'{-d+,--destdir=}'[set download directory]:download directory:_files -/' \
  '(-f --force)'{-f,--force}'[allow non-empty destination directory]' \
  '(-v --verbose)'{-v,--verbose}'[print configuration and report progress]' \
  --list"[list versions; don't download]" \
  --binary'[operate on binary packages (default: source packages)]' \
  '*'{-a+,--architecture=}'[specify architectures to download]:architecture to download:_deb_architectures' \
  --first='[download all versions newer than this]:version number (lower bound):->versions' \
  --last='[download all versions older than this]:version number (upper bound):->versions' \
  '(-)'{-h,--help}'[show usage information]' \
  '(-)'--version'[show version number and license]' \
  '1: :->package' \
  '2:version number to download:->versions' \
  && ret=0

# -a implies --binary
if (( ${+opt_args[-a]} || ${+opt_args[--architecture]} )); then
  opt_args[--binary]=''
fi

case $state in
  (package)
    if (( ${+opt_args[--binary]} )); then
      _description binary-packages expl 'binary package to download'
      _deb_packages "${expl[@]}" avail && ret=0
    else
      _description source-packages expl 'source package to download'
      _deb_packages "${expl[@]}" source && ret=0
    fi
    ;;
  (versions)
    local package=${(Q)line[1]}
    if [[ -n $package ]]; then
      local -a versions=( ${(f)"$(_call_program versions debsnap --list ${(@kv)opt_args[(I)(-a|--architecture|--binary)]} -- ${line[1]})"} )
      # TODO: filter ${versions} to only those between ${opt_args[--first]} and ${opt_args[--last]}
      _description versions expl ${state_descr}
      compadd "$@" "${expl[@]}" -a versions && ret=0
    else
      _message -- $state_descr && ret=0
    fi
    ;;
esac

return ret
debug log:

solving 40389375c ...
found 40389375c in https://inbox.vuxu.org/zsh-workers/20200427113813.1701-1-danielsh@tarpaulin.shahaf.local2/

applying [1/1] https://inbox.vuxu.org/zsh-workers/20200427113813.1701-1-danielsh@tarpaulin.shahaf.local2/
diff --git a/Completion/Debian/Command/_debsnap b/Completion/Debian/Command/_debsnap
new file mode 100644
index 000000000..40389375c

Checking patch Completion/Debian/Command/_debsnap...
Applied patch Completion/Debian/Command/_debsnap cleanly.

index at:
100644 40389375c21c813fa2d4ab61b932295699721c91	Completion/Debian/Command/_debsnap

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).