pwdx: New completion.
This commit is contained in:
parent
fa2876b51d
commit
5bb9343fba
@ -57,6 +57,22 @@ have pgrep && complete -F _pgrep pgrep
|
||||
# Linux pidof(8) completion.
|
||||
[ $UNAME = Linux ] && complete -F _pgrep pidof
|
||||
|
||||
have pwdx &&
|
||||
_pwdx()
|
||||
{
|
||||
local cur prev words cword
|
||||
_init_completion || return
|
||||
|
||||
[[ $prev == -V ]] && return
|
||||
|
||||
if [[ $cur == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '-V' -- "$cur" ) )
|
||||
else
|
||||
_pids
|
||||
fi
|
||||
} &&
|
||||
complete -F _pwdx pwdx
|
||||
|
||||
# Local variables:
|
||||
# mode: shell-script
|
||||
# sh-basic-offset: 4
|
||||
|
1
test/completion/pwdx.exp
Normal file
1
test/completion/pwdx.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions pwdx
|
20
test/lib/completions/pwdx.exp
Normal file
20
test/lib/completions/pwdx.exp
Normal file
@ -0,0 +1,20 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "pwdx "
|
||||
|
||||
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user