Add mktemp(1) completion.
This commit is contained in:
parent
25df309263
commit
74128a73ce
6
CHANGES
6
CHANGES
@ -13,9 +13,9 @@ bash-completion (2.x)
|
||||
[ Ville Skyttä ]
|
||||
* Activate hping2 completion also for hping and hping3.
|
||||
* Add badblocks, compgen, crontab, dumpe2fs, e2freefrag, e2label, ether-wake,
|
||||
filefrag, growisofs, iftop, ip (Debian: #600617), lrzip, lsof, portecle,
|
||||
POSIX sh, sha{,224,256,384,512}sum, sysbench, tune2fs, xmodmap, and xrdb
|
||||
completions.
|
||||
filefrag, growisofs, iftop, ip (Debian: #600617), lrzip, lsof, mktemp,
|
||||
portecle, POSIX sh, sha{,224,256,384,512}sum, sysbench, tune2fs, xmodmap,
|
||||
and xrdb completions.
|
||||
* Add *.gif (Alioth: #312512), *.m2t (Alioth: #312770), *.3gpp, *.3gpp2,
|
||||
*.awb, and *.iso (Alioth: #311420) to mplayer filename completions.
|
||||
* Add "short" tarball extensions to unxz, unlzma etc completions.
|
||||
|
@ -112,6 +112,34 @@ _id()
|
||||
} &&
|
||||
complete -F _id id
|
||||
|
||||
# mktemp(1) completion
|
||||
#
|
||||
have mktemp &&
|
||||
_mktemp()
|
||||
{
|
||||
COMPREPLY=()
|
||||
local cur prev split=false
|
||||
_get_comp_words_by_ref cur prev
|
||||
|
||||
_split_longopt && split=true
|
||||
|
||||
case "$prev" in
|
||||
--help|--version|--suffix)
|
||||
return 0
|
||||
;;
|
||||
--tmpdir|-p)
|
||||
_filedir -d
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return 0
|
||||
|
||||
[[ "$cur" == -* ]] && \
|
||||
COMPREPLY=( $( compgen -W '-d -u -q -p -t' -- "$cur" ) )
|
||||
} &&
|
||||
complete -F _mktemp mktemp
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
|
1
test/completion/mktemp.exp
Normal file
1
test/completion/mktemp.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions mktemp
|
20
test/lib/completions/mktemp.exp
Normal file
20
test/lib/completions/mktemp.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "mktemp -"
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user