zsh-workers
 help / color / mirror / code / Atom feed
82b382b971d92a1ee4f134a0ffd27a9bf59dce4a blob 2212 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
 
#compdef rm grm zf_rm

local variant
declare -a args opts=( -A '-*' )
args=(
  '(-f --force)'{-f,--force}'[ignore nonexistent files, never prompt]'
  '(-I --interactive)-i[prompt before every removal]'
  '(-r -R --recursive)'{-r,-R,--recursive}'[remove directories and their contents recursively]'
  '*:: :->file'
)
_pick_variant -r variant -b zsh gnu=gnu $OSTYPE --help
case $variant; in
  gnu)
    opts=()
    args+=(
      '(-i --interactive)-I[prompt when removing many files]'
      '(-i -I)--interactive=-[prompt under given condition (defaulting to always)]::when:((once\:"prompt when removing many files"
                                                                                           always\:"prompt before every removal"))'
      '--one-file-system[stay within filesystems of files given as arguments]'
      '(                   --preserve-root)--no-preserve-root[do not treat / specially]'
      '(--no-preserve-root                )--preserve-root[do not remove / (default)]'
      '(-d --dir)'{-d,--dir}'[remove directories as well]'
      '(-v --verbose)'{-v,--verbose}'[explain what is being done]'
      '(- *)--help[display help message and exit]'
      '(- *)--version[output version information and exit]'
    )
    ;;
  *)
    args=(${args:#*)--*\[*})
    ;|
  darwin*|dragonfly*|freebsd*|netbsd*|openbsd*|zsh)
    args+=(
      '-d[remove directories as well]'
    )
    ;|
  zsh)
    args+=(
      '-s[enable paranoid behavior]'
    )
    ;;
  darwin*|dragonfly*|freebsd*|netbsd*|openbsd*)
    args+=(
      '-P[overwrite files before deleting them]'
      '-v[explain what is being done]'
    )
    ;|
  darwin*|dragonfly*|freebsd*|netbsd*)
    args+=(
      '-W[attempt to undelete named files]'
    )
    ;|
  dragonfly*|freebsd*|netbsd*)
    args+=(
      "-x[don't cross file systems when removing a hierarchy]"
    )
    ;|
  dragonfly*|freebsd*)
    args+=(
      '(-i)-I[prompt when removing many files]'
    )
    ;;
esac

local curcontext=$curcontext state line ret=1
declare -A opt_args

_arguments -C -s -S $opts \
  $args && ret=0

case $state in
  (file)
    line=( ${line//(#m)[\[\]()\\*?#<>~\^\|]/\\$MATCH} )
    _files -F line && ret=0
    ;;
esac

return $ret
debug log:

solving 82b382b ...
found 82b382b in https://inbox.vuxu.org/zsh-workers/20200621120913.tk5caqwb3ob2r6wt@localhost/
found ea9190d in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 ea9190de22c8e0049e7ea2a2db2f98562b76bcb5	Completion/Unix/Command/_rm

applying [1/1] https://inbox.vuxu.org/zsh-workers/20200621120913.tk5caqwb3ob2r6wt@localhost/
diff --git a/Completion/Unix/Command/_rm b/Completion/Unix/Command/_rm
index ea9190d..82b382b 100644

Checking patch Completion/Unix/Command/_rm...
Applied patch Completion/Unix/Command/_rm cleanly.

index at:
100644 82b382b971d92a1ee4f134a0ffd27a9bf59dce4a	Completion/Unix/Command/_rm

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