chrpath: New completion.
This commit is contained in:
parent
e1a3492261
commit
b9a5f508e2
@ -21,6 +21,7 @@ bashcomp_DATA = abook \
|
|||||||
cardctl \
|
cardctl \
|
||||||
cfengine \
|
cfengine \
|
||||||
chkconfig \
|
chkconfig \
|
||||||
|
chrpath \
|
||||||
chsh \
|
chsh \
|
||||||
cksfv \
|
cksfv \
|
||||||
clisp \
|
clisp \
|
||||||
|
33
completions/chrpath
Normal file
33
completions/chrpath
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
have chrpath || return
|
||||||
|
|
||||||
|
_chrpath()
|
||||||
|
{
|
||||||
|
local cur prev words cword
|
||||||
|
_init_completion || return
|
||||||
|
|
||||||
|
case $prev in
|
||||||
|
-v|--version|-h|--help)
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
-r|--replace)
|
||||||
|
_filedir -d
|
||||||
|
return
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
if [[ $cur == -* ]]; then
|
||||||
|
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
_filedir
|
||||||
|
} &&
|
||||||
|
complete -F _chrpath chrpath
|
||||||
|
|
||||||
|
# Local variables:
|
||||||
|
# mode: shell-script
|
||||||
|
# sh-basic-offset: 4
|
||||||
|
# sh-indent-comment: t
|
||||||
|
# indent-tabs-mode: nil
|
||||||
|
# End:
|
||||||
|
# ex: ts=4 sw=4 et filetype=sh
|
1
test/completion/chrpath.exp
Normal file
1
test/completion/chrpath.exp
Normal file
@ -0,0 +1 @@
|
|||||||
|
assert_source_completions chrpath
|
21
test/lib/completions/chrpath.exp
Normal file
21
test/lib/completions/chrpath.exp
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
proc setup {} {
|
||||||
|
save_env
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
proc teardown {} {
|
||||||
|
assert_env_unmodified
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setup
|
||||||
|
|
||||||
|
|
||||||
|
assert_complete_any "chrpath "
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
assert_complete_any "chrpath -"
|
||||||
|
sync_after_int
|
||||||
|
|
||||||
|
|
||||||
|
teardown
|
Loading…
x
Reference in New Issue
Block a user