hexdump: New completion.
This commit is contained in:
parent
12ae7eb214
commit
552a2f2a94
1
completions/.gitignore
vendored
1
completions/.gitignore
vendored
@ -50,6 +50,7 @@ gnumake
|
|||||||
gpc
|
gpc
|
||||||
hciattach
|
hciattach
|
||||||
hciconfig
|
hciconfig
|
||||||
|
hd
|
||||||
host
|
host
|
||||||
hping
|
hping
|
||||||
hping3
|
hping3
|
||||||
|
@ -120,6 +120,7 @@ bashcomp_DATA = a2x \
|
|||||||
gzip \
|
gzip \
|
||||||
hcitool \
|
hcitool \
|
||||||
hddtemp \
|
hddtemp \
|
||||||
|
hexdump \
|
||||||
hid2hci \
|
hid2hci \
|
||||||
hping2 \
|
hping2 \
|
||||||
htop \
|
htop \
|
||||||
@ -430,6 +431,7 @@ CLEANFILES = \
|
|||||||
gpc \
|
gpc \
|
||||||
hciattach \
|
hciattach \
|
||||||
hciconfig \
|
hciconfig \
|
||||||
|
hd \
|
||||||
host \
|
host \
|
||||||
hping \
|
hping \
|
||||||
hping3 \
|
hping3 \
|
||||||
@ -663,6 +665,10 @@ symlinks: $(targetdir) $(DATA)
|
|||||||
rm -f $(targetdir)/$$file && \
|
rm -f $(targetdir)/$$file && \
|
||||||
$(LN_S) hcitool $(targetdir)/$$file ; \
|
$(LN_S) hcitool $(targetdir)/$$file ; \
|
||||||
done
|
done
|
||||||
|
for file in hd ; do \
|
||||||
|
rm -f $(targetdir)/$$file && \
|
||||||
|
$(LN_S) hexdump $(targetdir)/$$file ; \
|
||||||
|
done
|
||||||
for file in hping hping3 ; do \
|
for file in hping hping3 ; do \
|
||||||
rm -f $(targetdir)/$$file && \
|
rm -f $(targetdir)/$$file && \
|
||||||
$(LN_S) hping2 $(targetdir)/$$file ; \
|
$(LN_S) hping2 $(targetdir)/$$file ; \
|
||||||
|
29
completions/hexdump
Normal file
29
completions/hexdump
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
# hexdump(1) completion -*- shell-script -*-
|
||||||
|
|
||||||
|
_hexdump()
|
||||||
|
{
|
||||||
|
local cur prev words cword
|
||||||
|
_init_completion || return
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
-V|-e|-n|-s)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
-f)
|
||||||
|
_filedir
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $cur == -* ]]; then
|
||||||
|
local opts="$( _parse_help "$1" )"
|
||||||
|
[[ $opts ]] || opts="$( _parse_usage "$1" )"
|
||||||
|
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
_filedir
|
||||||
|
} &&
|
||||||
|
complete -F _hexdump hexdump
|
||||||
|
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/hexdump.exp
Normal file
1
test/completion/hexdump.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions hexdump
|
18
test/lib/completions/hexdump.exp
Normal file
18
test/lib/completions/hexdump.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "hexdump -"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user