pinfo: New completion, reusing the one for info.
This commit is contained in:
parent
e7b3abf689
commit
dfaf85f197
@ -1,6 +1,6 @@
|
||||
# bash completion for info
|
||||
|
||||
have info || return
|
||||
have info || have pinfo || return
|
||||
|
||||
_info()
|
||||
{
|
||||
@ -16,14 +16,20 @@ _info()
|
||||
fi
|
||||
|
||||
case $prev in
|
||||
-k|--apropos|--index-search|-n|--node)
|
||||
-k|--apropos|--index-search|-n|--node|-h|--help|-v|--version)
|
||||
return
|
||||
;;
|
||||
-d|--directory)
|
||||
-d)
|
||||
if [[ ${1##*/} == info ]]; then
|
||||
_filedir -d
|
||||
return
|
||||
fi
|
||||
;;
|
||||
--directory)
|
||||
_filedir -d
|
||||
return
|
||||
;;
|
||||
--dribble|-f|--file|-o|--output|--restore)
|
||||
--dribble|-f|--file|-o|--output|--restore|-r|--raw-filename|--rcfile)
|
||||
_filedir
|
||||
return
|
||||
;;
|
||||
@ -68,7 +74,7 @@ _info()
|
||||
|
||||
return 0
|
||||
} &&
|
||||
complete -F _info info
|
||||
complete -F _info info pinfo
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
|
1
test/completion/pinfo.exp
Normal file
1
test/completion/pinfo.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions pinfo
|
20
test/lib/completions/pinfo.exp
Normal file
20
test/lib/completions/pinfo.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "pinfo "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user