checksec: New completion

This commit is contained in:
Ville Skyttä 2015-07-06 18:15:46 +03:00
parent 2779b66e5d
commit ffd9038923
4 changed files with 57 additions and 0 deletions

View File

@ -42,6 +42,7 @@ bashcomp_DATA = 2to3 \
change_pw \
check_db \
check_perms \
checksec \
_chfn \
chgrp \
chkconfig \

37
completions/checksec Normal file
View 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

View File

@ -0,0 +1 @@
assert_source_completions checksec

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "checksec -"
sync_after_int
teardown