]> git.ipfire.org Git - thirdparty/util-linux.git/blob - bash-completion/hexdump
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / hexdump
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
8 '-L'|'--color')
9 COMPREPLY=( $(compgen -W "auto never always" -- $cur) )
10 return 0
11 ;;
12 '-e'|'--format')
13 COMPREPLY=( $(compgen -W "format" -- $cur) )
14 return 0
15 ;;
16 '-n'|'--length')
17 COMPREPLY=( $(compgen -W "length" -- $cur) )
18 return 0
19 ;;
20 '-s'|'--skip')
21 COMPREPLY=( $(compgen -W "offset" -- $cur) )
22 return 0
23 ;;
24 '-V'|'--version'|'-h'|'--help')
25 return 0
26 ;;
27 esac
28 case $cur in
29 -*)
30 OPTS=" --one-byte-octal
31 --one-byte-char
32 --canonical
33 --two-bytes-decimal
34 --two-bytes-octal
35 --two-bytes-hex
36 --color=
37 --format
38 --format-file
39 --length
40 --skip
41 --no-squeezing
42 --version
43 --help"
44 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
45 return 0
46 ;;
47 esac
48 local IFS=$'\n'
49 compopt -o filenames
50 COMPREPLY=( $(compgen -f -- $cur) )
51 return 0
52 }
53 complete -F _hexdump_module hexdump