dropuser: New completion
This commit is contained in:
parent
7999f28f62
commit
3cf50a1437
1
completions/.gitignore
vendored
1
completions/.gitignore
vendored
@ -37,6 +37,7 @@ dpkg-deb
|
||||
dpkg-query
|
||||
dpkg-reconfigure
|
||||
dropdb
|
||||
dropuser
|
||||
edquota
|
||||
f77
|
||||
f95
|
||||
|
@ -455,6 +455,7 @@ CLEANFILES = \
|
||||
dpkg-query \
|
||||
dpkg-reconfigure \
|
||||
dropdb \
|
||||
dropuser \
|
||||
edquota \
|
||||
f77 \
|
||||
f95 \
|
||||
@ -829,7 +830,7 @@ symlinks: $(targetdir) $(DATA)
|
||||
rm -f $(targetdir)/$$file && \
|
||||
$(LN_S) pm-hibernate $(targetdir)/$$file ; \
|
||||
done
|
||||
for file in createdb createuser dropdb ; do \
|
||||
for file in createdb createuser dropdb dropuser ; do \
|
||||
rm -f $(targetdir)/$$file && \
|
||||
$(LN_S) psql $(targetdir)/$$file ; \
|
||||
done
|
||||
|
@ -116,6 +116,38 @@ _dropdb()
|
||||
} &&
|
||||
complete -F _dropdb dropdb
|
||||
|
||||
# dropuser(1) completion
|
||||
#
|
||||
_dropuser()
|
||||
{
|
||||
local cur prev words cword split
|
||||
_init_completion -s || return
|
||||
|
||||
case $prev in
|
||||
--help|--version|-p|--port)
|
||||
return
|
||||
;;
|
||||
-h|--host)
|
||||
_known_hosts_real "$cur"
|
||||
return
|
||||
;;
|
||||
-U|--username)
|
||||
_pg_users
|
||||
return
|
||||
;;
|
||||
esac
|
||||
|
||||
$split && return
|
||||
|
||||
if [[ "$cur" == -* ]]; then
|
||||
COMPREPLY=( $( compgen -W '$( _parse_help "$1" )' -- "$cur" ) )
|
||||
[[ $COMPREPLY == *= ]] && compopt -o nospace
|
||||
else
|
||||
_pg_users
|
||||
fi
|
||||
} &&
|
||||
complete -F _dropuser dropuser
|
||||
|
||||
# psql(1) completion
|
||||
#
|
||||
_psql()
|
||||
|
1
test/completion/dropuser.exp
Normal file
1
test/completion/dropuser.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions dropuser
|
18
test/lib/completions/dropuser.exp
Normal file
18
test/lib/completions/dropuser.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "dropuser "
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user