checksec: New completion
This commit is contained in:
parent
2779b66e5d
commit
ffd9038923
@ -42,6 +42,7 @@ bashcomp_DATA = 2to3 \
|
|||||||
change_pw \
|
change_pw \
|
||||||
check_db \
|
check_db \
|
||||||
check_perms \
|
check_perms \
|
||||||
|
checksec \
|
||||||
_chfn \
|
_chfn \
|
||||||
chgrp \
|
chgrp \
|
||||||
chkconfig \
|
chkconfig \
|
||||||
|
37
completions/checksec
Normal file
37
completions/checksec
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
# bash completion for checksec -*- shell-script -*-
|
||||||
|
|
||||||
|
_checksec()
|
||||||
|
{
|
||||||
|
local cur prev words cword
|
||||||
|
_init_completion || return
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
--version|--help)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
--file|--fortify-file)
|
||||||
|
_filedir
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
--dir)
|
||||||
|
_filedir -d
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
--proc)
|
||||||
|
_pnames
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
--proc-libs|--fortify-proc)
|
||||||
|
_pids
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $cur == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
} &&
|
||||||
|
complete -F _checksec checksec
|
||||||
|
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/checksec.exp
Normal file
1
test/completion/checksec.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions checksec
|
18
test/lib/completions/checksec.exp
Normal file
18
test/lib/completions/checksec.exp
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "checksec -"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user