zsh-workers
 help / color / mirror / code / Atom feed
9c95ac69227f64b02ce71bdda81ff23be23b605f blob 3603 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
78
 
#compdef column

local variant ret=1
local -a context state line expl args columns MATCH aopts=( -A '-*' )
local -i MBEGIN MEND
local -A opt_args

# Debian and its derivatives (as of 2019) ship with a slightly customised
# version of the BSD column instead of the util-linux one. It can be identified
# by the presence of the custom option -n in the synopsis
_pick_variant -r variant \
  util-linux='(#i)util-linux' \
  debian='\[-[A-Za-z]#n[A-Za-z]#\]' \
  $OSTYPE \
--version

case $variant in
  util-linux)
    aopts=()
    args=(
      '(info json -c --output-width)'{-c+,--output-width=}'[format output to fit display of specified width]:width'
      '(info)'{-L,--table-empty-lines}"[don't ignore empty lines]"
      + fill
      # Yes, util-linux `column -x` does the exact opposite of BSD `column -x`
      '(info table text json -x --fillrows)'{-x,--fillrows}'[fill rows before filling columns]'
      + table
      '(info fill -t --table)'{-t,--table}'[create a table]'
      '(info fill -s --separator)'{-s+,--separator=}'[specify column delimiters in input data]:delimiters'
      '(info fill -O --table-order)'{-O+,--table-order=}'[specify order of output columns]: :->columns'
      '(info fill -N --table-columns)'{-N+,--table-columns=}'[specify column names]:names'
      '(info fill -H --table-hide)'{-H+,--table-hide=}"[don't print specified columns]: :->columns"
      + text
      '(info fill json -d --table-noheadings)'{-d,--table-noheadings}"[don't print header]"
      '(info fill json -E --table-noextreme)'{-E+,--table-noextreme}"[specify columns where length can be ignored]: :->columns"
      '(info fill json -e --table-header-repeat)'{-e,--table-header-repeat}'[repeat header for each page]'
      '(info fill json -R --table-right)'{-R+,--table-right=}'[right align text in these columns]: :->columns'
      '(info fill json -T --table-truncate)'{-T+,--table-truncate=}'[truncate text in the columns when necessary]: :->columns'
      '(info fill json -W --table-wrap)'{-W+,--table-wrap=}'[wrap text in the columns when necessary]: :->columns'
      '(info fill json -r --tree)'{-r+,--tree=}'[specify column to format tree-like]: :->columns'
      '(info fill json -i --tree-id)'{-i+,--tree-id=}'[specify column containing ID for child-parent relations]: :->columns'
      '(info fill json -p --tree-parent)'{-p+,--tree-parent=}'[specify column containing reference to parent]: :->columns'
      + json
      '(info fill text -n --table-name -c --output-width)'{-n+,--table-name=}'[specify table name for JSON output]:name'
      '(info fill text -J --json -c --output-width)'{-J,--json}'[use JSON output format for table]'
      + info
      '(- *)'{-h,--help}'[display usage information]'
      '(- *)'{-V,--version}'[display version information]'
    )
  ;;
  debian)
    aopts=()
    args=(
      "(-x)-n[don't merge multiple adjacent delimiters]"
      "-e[don't ignore empty lines]"
    )
  ;& # FALL THROUGH
  *)
    args+=(
      '(-t -s)-c+[format output to fit display of specified width]:width'
      '(-c -x)-t[create a table]'
      '(-c -x)-s+[specify column delimiters in input data]:delimiters'
      '(-n -t -s)-x[fill columns before filling rows]'
    )
  ;;
esac

_arguments -s -S $aopts '*:file:_files' $args && ret=0

if [[ -n $state ]]; then
  columns=( ${(s.,.)${(Q)${opt_args[table--N]:-$opt_args[table---table-columns]}//(#m)\\([\\:])/${MATCH[2]}}} )
  if (( $#columns )); then
    ${${(M)state:#*s}:+_sequence} _wanted -C "$context[1]" columns expl column compadd -a - columns && ret=0
  else
    _message -e columns "$state"
  fi
fi

return ret
debug log:

solving 9c95ac692 ...
found 9c95ac692 in https://inbox.vuxu.org/zsh-workers/4CF49770-4291-41D2-A0EA-049F623E6A26@dana.is/
found a81684dba in https://git.vuxu.org/mirror/zsh/
preparing index
index prepared:
100644 a81684dba2a3f99cdbfac6adc2900aa4bc874d43	Completion/Unix/Command/_column

applying [1/1] https://inbox.vuxu.org/zsh-workers/4CF49770-4291-41D2-A0EA-049F623E6A26@dana.is/
diff --git a/Completion/Unix/Command/_column b/Completion/Unix/Command/_column
index a81684dba..9c95ac692 100644

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

index at:
100644 9c95ac69227f64b02ce71bdda81ff23be23b605f	Completion/Unix/Command/_column

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