createuser: New completion
This commit is contained in:
parent
e71b4522d1
commit
7999f28f62
1
completions/.gitignore
vendored
1
completions/.gitignore
vendored
@ -28,6 +28,7 @@ composite
|
||||
conjure
|
||||
cowthink
|
||||
createdb
|
||||
createuser
|
||||
dcop
|
||||
declare
|
||||
dfutool
|
||||
|
@ -446,6 +446,7 @@ CLEANFILES = \
|
||||
conjure \
|
||||
cowthink \
|
||||
createdb \
|
||||
createuser \
|
||||
dcop \
|
||||
declare \
|
||||
dfutool \
|
||||
@ -828,7 +829,7 @@ symlinks: $(targetdir) $(DATA)
|
||||
rm -f $(targetdir)/$$file && \
|
||||
$(LN_S) pm-hibernate $(targetdir)/$$file ; \
|
||||
done
|
||||
for file in createdb dropdb ; do \
|
||||
for file in createdb createuser dropdb ; do \
|
||||
rm -f $(targetdir)/$$file && \
|
||||
$(LN_S) psql $(targetdir)/$$file ; \
|
||||
done
|
||||
|
@ -53,6 +53,36 @@ _createdb()
|
||||
} &&
|
||||
complete -F _createdb createdb
|
||||
|
||||
# createuser(1) completion
|
||||
#
|
||||
_createuser()
|
||||
{
|
||||
local cur prev words cword split
|
||||
_init_completion -s || return
|
||||
|
||||
case $prev in
|
||||
--help|--version|-p|--port|-c|--connection-limit)
|
||||
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
|
||||
fi
|
||||
} &&
|
||||
complete -F _createuser createuser
|
||||
|
||||
# dropdb(1) completion
|
||||
#
|
||||
_dropdb()
|
||||
|
1
test/completion/createuser.exp
Normal file
1
test/completion/createuser.exp
Normal file
@ -0,0 +1 @@
|
||||
assert_source_completions createuser
|
18
test/lib/completions/createuser.exp
Normal file
18
test/lib/completions/createuser.exp
Normal file
@ -0,0 +1,18 @@
|
||||
proc setup {} {
|
||||
save_env
|
||||
}
|
||||
|
||||
|
||||
proc teardown {} {
|
||||
assert_env_unmodified
|
||||
}
|
||||
|
||||
|
||||
setup
|
||||
|
||||
|
||||
assert_complete_any "createuser -"
|
||||
sync_after_int
|
||||
|
||||
|
||||
teardown
|
Loading…
x
Reference in New Issue
Block a user