dropuser: New completion

master
Ville Skyttä 2015-01-18 22:11:19 +02:00
parent 7999f28f62
commit 3cf50a1437
5 changed files with 54 additions and 1 deletions

View File

@ -37,6 +37,7 @@ dpkg-deb
dpkg-query
dpkg-reconfigure
dropdb
dropuser
edquota
f77
f95

View File

@ -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

View File

@ -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()

View File

@ -0,0 +1 @@
assert_source_completions dropuser

View File

@ -0,0 +1,18 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "dropuser "
sync_after_int
teardown