]>
Commit | Line | Data |
---|---|---|
c72fca2c SK |
1 | _hexdump_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 | |
768f3152 SK |
8 | '-L'|'--color') |
9 | COMPREPLY=( $(compgen -W "auto never always" -- $cur) ) | |
10 | return 0 | |
11 | ;; | |
cdeb4292 | 12 | '-e'|'--format') |
c72fca2c SK |
13 | COMPREPLY=( $(compgen -W "format" -- $cur) ) |
14 | return 0 | |
15 | ;; | |
cdeb4292 | 16 | '-n'|'--length') |
c72fca2c SK |
17 | COMPREPLY=( $(compgen -W "length" -- $cur) ) |
18 | return 0 | |
19 | ;; | |
cdeb4292 | 20 | '-s'|'--skip') |
c72fca2c SK |
21 | COMPREPLY=( $(compgen -W "offset" -- $cur) ) |
22 | return 0 | |
23 | ;; | |
cdeb4292 | 24 | '-V'|'--version'|'-h'|'--help') |
d4f9b8d7 VS |
25 | return 0 |
26 | ;; | |
c72fca2c SK |
27 | esac |
28 | case $cur in | |
29 | -*) | |
cdeb4292 | 30 | OPTS=" --one-byte-octal |
bbf5bf8a | 31 | --one-byte-hex |
cdeb4292 SK |
32 | --one-byte-char |
33 | --canonical | |
34 | --two-bytes-decimal | |
35 | --two-bytes-octal | |
36 | --two-bytes-hex | |
768f3152 | 37 | --color= |
cdeb4292 SK |
38 | --format |
39 | --format-file | |
40 | --length | |
41 | --skip | |
42 | --no-squeezing | |
43 | --version | |
44 | --help" | |
c72fca2c SK |
45 | COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) ) |
46 | return 0 | |
47 | ;; | |
48 | esac | |
ce3e6b15 | 49 | local IFS=$'\n' |
c72fca2c SK |
50 | compopt -o filenames |
51 | COMPREPLY=( $(compgen -f -- $cur) ) | |
52 | return 0 | |
53 | } | |
54 | complete -F _hexdump_module hexdump |