| 1 |
_column_module() |
| 2 |
{ |
| 3 |
local cur prev OPTS |
| 4 |
COMPREPLY=() |
| 5 |
cur="${COMP_WORDS[COMP_CWORD]}" |
| 6 |
prev="${COMP_WORDS[COMP_CWORD-1]}" |
| 7 |
case $prev in |
| 8 |
'-c'|'--output-width'|'-l'|'--table-columns-limit'|'-S'|'--use-spaces') |
| 9 |
COMPREPLY=( $(compgen -W "number" -- $cur) ) |
| 10 |
return 0 |
| 11 |
;; |
| 12 |
'--color') |
| 13 |
COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) |
| 14 |
return 0 |
| 15 |
;; |
| 16 |
'-s'|'--separator'|'--input-separator'|'-o'|'--output-separator'|'-n'|'--table-name'|'-O') |
| 17 |
COMPREPLY=( $(compgen -W "string" -- $cur) ) |
| 18 |
return 0 |
| 19 |
;; |
| 20 |
'-O'|'--table-order'|'-N'|'--table-columns'|'-E'|'--table-noextreme'|'-H'|'--table-hide'|'-R'|'--table-right'|'-T'|'--table-truncate'|'-W'|'--table-wrap') |
| 21 |
COMPREPLY=( $(compgen -W "string" -- $cur) ) |
| 22 |
return 0 |
| 23 |
;; |
| 24 |
'-r'|'--tree'|'-i'|'--tree-id'|'-p'|'--tree-parent') |
| 25 |
COMPREPLY=( $(compgen -W "string" -- $cur) ) |
| 26 |
return 0 |
| 27 |
;; |
| 28 |
'-h'|'--help'|'-V'|'--version') |
| 29 |
return 0 |
| 30 |
;; |
| 31 |
esac |
| 32 |
case $cur in |
| 33 |
-*) |
| 34 |
OPTS="--columns |
| 35 |
--table |
| 36 |
--table-colorscheme |
| 37 |
--table-name |
| 38 |
--table-order |
| 39 |
--table-column |
| 40 |
--table-columns |
| 41 |
--table-columns-limit |
| 42 |
--table-noextreme |
| 43 |
--table-noheadings |
| 44 |
--table-maxout |
| 45 |
--table-header-as-columns |
| 46 |
--table-header-repeat |
| 47 |
--table-hide |
| 48 |
--table-right |
| 49 |
--table-truncate |
| 50 |
--table-wrap |
| 51 |
--keep-empty-lines |
| 52 |
--json |
| 53 |
--tree |
| 54 |
--tree-id |
| 55 |
--tree-parent |
| 56 |
--output-width |
| 57 |
--separator |
| 58 |
--input-separator |
| 59 |
--output-separator |
| 60 |
--wrap-separator |
| 61 |
--fillrows |
| 62 |
--use-spaces |
| 63 |
--color |
| 64 |
--help |
| 65 |
--version" |
| 66 |
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
| 67 |
return 0 |
| 68 |
;; |
| 69 |
esac |
| 70 |
local IFS=$'\n' |
| 71 |
compopt -o filenames |
| 72 |
COMPREPLY=( $(compgen -f -- $cur) ) |
| 73 |
return 0 |
| 74 |
} |
| 75 |
complete -F _column_module column |