lzip: New completion.
This commit is contained in:
parent
17c9722733
commit
f09ced610d
@ -170,6 +170,7 @@ bashcomp_DATA = a2x \
|
|||||||
lrzip \
|
lrzip \
|
||||||
lsof \
|
lsof \
|
||||||
lvm \
|
lvm \
|
||||||
|
lzip \
|
||||||
lzma \
|
lzma \
|
||||||
lzop \
|
lzop \
|
||||||
macof \
|
macof \
|
||||||
|
44
completions/lzip
Normal file
44
completions/lzip
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
# lzip(1) completion -*- shell-script -*-
|
||||||
|
|
||||||
|
_lzip()
|
||||||
|
{
|
||||||
|
local cur prev words cword split
|
||||||
|
_init_completion -s || return
|
||||||
|
|
||||||
|
local decompress=false
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
-h|--help|-V|--version|-b|--member-size|-m|--match-length|\
|
||||||
|
-s|--dictionary-size|-S|--volume-size)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
-d|--decompress)
|
||||||
|
decompress=true
|
||||||
|
;;
|
||||||
|
-o|--output)
|
||||||
|
_filedir
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
$split && return
|
||||||
|
|
||||||
|
if [[ "$cur" == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" ) {-1..-9}' \
|
||||||
|
-- "$cur" ) )
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
if $decompress; then
|
||||||
|
_filedir lz
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
local IFS=$'\n'
|
||||||
|
compopt -o filenames
|
||||||
|
COMPREPLY=( $( compgen -f -X "*.lz" -- "$cur" ) \
|
||||||
|
$( compgen -d -- "$cur" ) )
|
||||||
|
} &&
|
||||||
|
complete -F _lzip lzip
|
||||||
|
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/lzip.exp
Normal file
1
test/completion/lzip.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions lzip
|
20
test/lib/completions/lzip.exp
Normal file
20
test/lib/completions/lzip.exp
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "lzip "
|
||||||
|
|
||||||
|
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user