]> git.ipfire.org Git - thirdparty/util-linux.git/blame - bash-completion/hexdump
rev: be careful with close()
[thirdparty/util-linux.git] / bash-completion / hexdump
CommitLineData
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
SK
30 OPTS=" --one-byte-octal
31 --one-byte-char
32 --canonical
33 --two-bytes-decimal
34 --two-bytes-octal
35 --two-bytes-hex
768f3152 36 --color=
cdeb4292
SK
37 --format
38 --format-file
39 --length
40 --skip
41 --no-squeezing
42 --version
43 --help"
c72fca2c
SK
44 COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
45 return 0
46 ;;
47 esac
ce3e6b15 48 local IFS=$'\n'
c72fca2c
SK
49 compopt -o filenames
50 COMPREPLY=( $(compgen -f -- $cur) )
51 return 0
52}
53complete -F _hexdump_module hexdump