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
|
# bash completion for info
|
||||||
|
|
||||||
have info || return
|
have info || have pinfo || return
|
||||||
|
|
||||||
_info()
|
_info()
|
||||||
{
|
{
|
||||||
@ -16,14 +16,20 @@ _info()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
case $prev in
|
case $prev in
|
||||||
-k|--apropos|--index-search|-n|--node)
|
-k|--apropos|--index-search|-n|--node|-h|--help|-v|--version)
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
-d|--directory)
|
-d)
|
||||||
|
if [[ ${1##*/} == info ]]; then
|
||||||
|
_filedir -d
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
--directory)
|
||||||
_filedir -d
|
_filedir -d
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
--dribble|-f|--file|-o|--output|--restore)
|
--dribble|-f|--file|-o|--output|--restore|-r|--raw-filename|--rcfile)
|
||||||
_filedir
|
_filedir
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
@ -68,7 +74,7 @@ _info()
|
|||||||
|
|
||||||
return 0
|
return 0
|
||||||
} &&
|
} &&
|
||||||
complete -F _info info
|
complete -F _info info pinfo
|
||||||
|
|
||||||
# Local variables:
|
# Local variables:
|
||||||
# mode: shell-script
|
# 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