Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#### Completions
- Added completions for
- `wireshark`, `tshark`, and `dumpcap`
- `dropdb`, `createdb`, `pg_restore`, `pg_dump` and `pg_dumpall`

### Deprecations and removed features

Expand Down
21 changes: 21 additions & 0 deletions share/completions/createdb.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
complete -c createdb --no-files -a '(__fish_complete_pg_database)'

# Options:
complete -c createdb -s D -l tablespace -x -d "Default tablespace for the database"
complete -c createdb -s e -l echo -d "Show the commands being sent to the server"
complete -c createdb -s E -l encoding -x -d "Encoding for the database"
complete -c createdb -s l -l locale -x -d "Locale settings for the database"
complete -c createdb -l lc-collate -x -d "LC_COLLATE setting for the database"
complete -c createdb -l lc-ctype -x -d "LC_CTYPE setting for the database"
complete -c createdb -s O -l owner -x -a '(__fish_complete_pg_user)' -d "Database user to own the new database"
complete -c createdb -s T -l template -x -a '(__fish_complete_pg_database)' -d "Template database to copy"
complete -c createdb -s V -l version -d "Output version information, then exit"
complete -c createdb -s '?' -l help -d "Show help, then exit"

# Connection options:
complete -c createdb -s h -l host -x -a '(__fish_print_hostnames)' -d "Database server host or socket directory"
complete -c createdb -s p -l port -x -d "Database server port"
complete -c createdb -s U -l username -x -a '(__fish_complete_pg_user)' -d "User name to connect as"
complete -c createdb -s w -l no-password -d "Never prompt for password"
complete -c createdb -s W -l password -d "Force password prompt"
complete -c createdb -l maintenance-db -x -a '(__fish_complete_pg_database)' -d "Alternate maintenance database"
16 changes: 16 additions & 0 deletions share/completions/dropdb.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
complete -c dropdb --no-files -a '(__fish_complete_pg_database)'

# Options:
complete -c dropdb -s e -l echo -d "Show the commands being sent to the server"
complete -c dropdb -s i -l interactive -d "Prompt before deleting anything"
complete -c dropdb -s V -l version -d "Output version information, then exit"
complete -c dropdb -l if-exists -d "Don't report error if database doesn't exist"
complete -c dropdb -s '?' -l help -d "Show help, then exit"

# Connection options:
complete -c dropdb -s h -l host -x -a '(__fish_print_hostnames)' -d "Database server host or socket directory"
complete -c dropdb -s p -l port -x -d "Database server port"
complete -c dropdb -s U -l username -x -a '(__fish_complete_pg_user)' -d "User name to connect as"
complete -c dropdb -s w -l no-password -d "Never prompt for password"
complete -c dropdb -s W -l password -d "Force password prompt"
complete -c dropdb -l maintenance-db -x -a '(__fish_complete_pg_database)' -d "Alternate maintenance database"
60 changes: 60 additions & 0 deletions share/completions/pg_dump.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
complete -c pg_dump --no-files -a '(__fish_complete_pg_database)'

# General options:
complete -c pg_dump -s f -l file -r -d "Output file or directory name"
complete -c pg_dump -s F -l format -x -a "p\t'Plain text' c\t'Custom format' d\t'Directory archive' t\t'Tar archive'" -d "Output file format"
complete -c pg_dump -s j -l jobs -x -d "Use this many parallel jobs to dump"
complete -c pg_dump -s v -l verbose -d "Verbose mode"
complete -c pg_dump -s V -l version -d "Output version information, then exit"
complete -c pg_dump -s Z -l compress -x -d "Compression level for compressed formats"
complete -c pg_dump -l lock-wait-timeout -x -d "Fail after waiting TIMEOUT for a table lock"
complete -c pg_dump -l no-sync -d "Do not wait for changes to be written safely to disk"
complete -c pg_dump -s '?' -l help -d "Show this help, then exit"

# Options controlling the output content:
complete -c pg_dump -s a -l data-only -d "Dump only the data, not the schema"
complete -c pg_dump -s b -l blobs -d "Include large objects in dump"
complete -c pg_dump -s B -l no-blobs -d "Exclude large objects in dump"
complete -c pg_dump -s c -l clean -d "Clean (drop) database objects before recreating"
complete -c pg_dump -s C -l create -d "Include commands to create database in dump"
complete -c pg_dump -s E -l encoding -x -d "Dump the data in encoding ENCODING"
complete -c pg_dump -s n -l schema -x -d "Dump the named schemas only"
complete -c pg_dump -s N -l exclude-schema -x -d "Do NOT dump the named schemas"
complete -c pg_dump -s o -l oids -d "Include OIDs in dump"
complete -c pg_dump -s O -l no-owner -d "Skip restoration of object ownership in plain-text format"
complete -c pg_dump -s s -l schema-only -d "Dump only the schema, no data"
complete -c pg_dump -s S -l superuser -x -d "Superuser user name to use in plain-text format"
complete -c pg_dump -s t -l table -x -d "Dump the named tables only"
complete -c pg_dump -s T -l exclude-table -x -d "Do NOT dump the named tables"
complete -c pg_dump -s x -l no-privileges -d "Do not dump privileges (grant/revoke)"
complete -c pg_dump -l binary-upgrade -d "For use by upgrade utilities only"
complete -c pg_dump -l column-inserts -d "Dump data as INSERT commands with column names"
complete -c pg_dump -l disable-dollar-quoting -d "Disable dollar quoting, use SQL standard quoting"
complete -c pg_dump -l disable-triggers -d "Disable triggers during data-only restore"
complete -c pg_dump -l enable-row-security -d "Enable row security (dump only content user has access to)"
complete -c pg_dump -l exclude-table-data -x -d "Do NOT dump data for the named tables"
complete -c pg_dump -l if-exists -d "Use IF EXISTS when dropping objects"
complete -c pg_dump -l inserts -d "Dump data as INSERT commands, rather than COPY"
complete -c pg_dump -l load-via-partition-root -d "Load partitions via the root table"
complete -c pg_dump -l no-comments -d "Do not dump comments"
complete -c pg_dump -l no-publications -d "Do not dump publications"
complete -c pg_dump -l no-security-labels -d "Do not dump security label assignments"
complete -c pg_dump -l no-subscriptions -d "Do not dump subscriptions"
complete -c pg_dump -l no-synchronized-snapshots -d "Do not use synchronized snapshots in parallel jobs"
complete -c pg_dump -l no-tablespaces -d "Do not dump tablespace assignments"
complete -c pg_dump -l no-unlogged-table-data -d "Do not dump unlogged table data"
complete -c pg_dump -l quote-all-identifiers -d "Quote all identifiers, even if not key words"
complete -c pg_dump -l section -x -a "pre-data data post-data" -d "Dump named section (pre-data, data, or post-data)"
complete -c pg_dump -l serializable-deferrable -d "Wait until the dump can run without anomalies"
complete -c pg_dump -l snapshot -x -d "Use given snapshot for the dump"
complete -c pg_dump -l strict-names -d "Require table and/or schema include patterns to match at least one entity each"
complete -c pg_dump -l use-set-session-authorization -d "Use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership"

# Connection options:
complete -c pg_dump -s d -l dbname -x -a '(__fish_complete_pg_database)' -d "Database to dump"
complete -c pg_dump -s h -l host -x -a '(__fish_print_hostnames)' -d "Database server host or socket directory"
complete -c pg_dump -s p -l port -x -d "Database server port number"
complete -c pg_dump -s U -l username -x -a '(__fish_complete_pg_user)' -d "Connect as specified database user"
complete -c pg_dump -s w -l no-password -d "Never prompt for password"
complete -c pg_dump -s W -l password -d "Force password prompt (should happen automatically)"
complete -c pg_dump -l role -x -d "Do SET ROLE before dump"
48 changes: 48 additions & 0 deletions share/completions/pg_dumpall.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
complete -c pg_dumpall --no-files

# General options:
complete -c pg_dumpall -s f -l file -r -d "Output file name"
complete -c pg_dumpall -s v -l verbose -d "Verbose mode"
complete -c pg_dumpall -s V -l version -d "Output version information, then exit"
complete -c pg_dumpall -l lock-wait-timeout -x -d "Fail after waiting TIMEOUT for a table lock"
complete -c pg_dumpall -s '?' -l help -d "Show this help, then exit"

# Options controlling the output content:
complete -c pg_dumpall -s a -l data-only -d "Dump only the data, not the schema"
complete -c pg_dumpall -s c -l clean -d "Clean (drop) database objects before recreating"
complete -c pg_dumpall -s E -l encoding -x -d "Dump the data in encoding ENCODING"
complete -c pg_dumpall -s g -l globals-only -d "Dump only global objects, no databases"
complete -c pg_dumpall -s o -l oids -d "Include OIDs in dump"
complete -c pg_dumpall -s O -l no-owner -d "Skip restoration of object ownership"
complete -c pg_dumpall -s r -l roles-only -d "Dump only roles, no databases or tablespaces"
complete -c pg_dumpall -s s -l schema-only -d "Dump only the schema, no data"
complete -c pg_dumpall -s S -l superuser -x -d "Superuser user name to use in the dump"
complete -c pg_dumpall -s t -l tablespaces-only -d "Dump only tablespaces, no databases or roles"
complete -c pg_dumpall -s x -l no-privileges -d "Do not dump privileges (grant/revoke)"
complete -c pg_dumpall -l binary-upgrade -d "For use by upgrade utilities only"
complete -c pg_dumpall -l column-inserts -d "Dump data as INSERT commands with column names"
complete -c pg_dumpall -l disable-dollar-quoting -d "Disable dollar quoting, use SQL standard quoting"
complete -c pg_dumpall -l disable-triggers -d "Disable triggers during data-only restore"
complete -c pg_dumpall -l if-exists -d "Use IF EXISTS when dropping objects"
complete -c pg_dumpall -l inserts -d "Dump data as INSERT commands, rather than COPY"
complete -c pg_dumpall -l load-via-partition-root -d "Load partitions via the root table"
complete -c pg_dumpall -l no-comments -d "Do not dump comments"
complete -c pg_dumpall -l no-publications -d "Do not dump publications"
complete -c pg_dumpall -l no-role-passwords -d "Do not dump passwords for roles"
complete -c pg_dumpall -l no-security-labels -d "Do not dump security label assignments"
complete -c pg_dumpall -l no-subscriptions -d "Do not dump subscriptions"
complete -c pg_dumpall -l no-sync -d "Do not wait for changes to be written safely to disk"
complete -c pg_dumpall -l no-tablespaces -d "Do not dump tablespace assignments"
complete -c pg_dumpall -l no-unlogged-table-data -d "Do not dump unlogged table data"
complete -c pg_dumpall -l quote-all-identifiers -d "Quote all identifiers, even if not key words"
complete -c pg_dumpall -l use-set-session-authorization -d "Use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership"

# Connection options:
complete -c pg_dumpall -s d -l dbname -x -a '(__fish_complete_pg_database)' -d "Database to dump"
complete -c pg_dumpall -s h -l host -x -a '(__fish_print_hostnames)' -d "Database server host or socket directory"
complete -c pg_dumpall -s l -l database -x -a '(__fish_complete_pg_database)' -d "Alternative default database"
complete -c pg_dumpall -s p -l port -x -d "Database server port number"
complete -c pg_dumpall -s U -l username -x -a '(__fish_complete_pg_user)' -d "Connect as specified database user"
complete -c pg_dumpall -s w -l no-password -d "Never prompt for password"
complete -c pg_dumpall -s W -l password -d "Force password prompt (should happen automatically)"
complete -c pg_dumpall -l role -x -d "Do SET ROLE before dump"
47 changes: 47 additions & 0 deletions share/completions/pg_restore.fish
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# General options:
complete -c pg_restore -s d -l dbname -x -a '(__fish_complete_pg_database)' -d "Connect to database name"
complete -c pg_restore -s f -l file -a '-' -r -d "Output file name (- for stdout)"
complete -c pg_restore -s F -l format -x -a "c\t'Custom format (pg_dump)' d\t'Directory archive' t\t'Tar archive'" -d "Backup file format (should be automatic)"
complete -c pg_restore -s l -l list -d "Print summarized TOC of the archive"
complete -c pg_restore -s v -l verbose -d "Verbose mode"
complete -c pg_restore -s V -l version -d "Output version information, then exit"
complete -c pg_restore -s '?' -l help -d "Show help, then exit"

# Options controlling the restore:
complete -c pg_restore -s a -l data-only -d "Restore only the data, no schema"
complete -c pg_restore -s c -l clean -d "Clean (drop) database objects before recreating"
complete -c pg_restore -s C -l create -d "Create the target database"
complete -c pg_restore -s e -l exit-on-error -d "Exit on error, default is to continue"
complete -c pg_restore -s I -l index -x -d "Restore named index"
complete -c pg_restore -s j -l jobs -x -d "Use this many parallel jobs to restore"
complete -c pg_restore -s L -l use-list -r -d "Use table of contents from this file for selecting/ordering output"
complete -c pg_restore -s n -l schema -x -d "Restore only objects in this schema"
complete -c pg_restore -s N -l exclude-schema -x -d "Do not restore objects in this schema"
complete -c pg_restore -s O -l no-owner -d "Skip restoration of object ownership"
complete -c pg_restore -s P -l function -x -d "Restore named function"
complete -c pg_restore -s s -l schema-only -d "Restore only the schema, no data"
complete -c pg_restore -s S -l superuser -x -a '(__fish_complete_pg_user)' -d "Superuser user name to use for disabling triggers"
complete -c pg_restore -s t -l table -x -d "Restore named relation (table, view, etc.)"
complete -c pg_restore -s T -l trigger -x -d "Restore named trigger"
complete -c pg_restore -s x -l no-privileges -d "Skip restoration of access privileges (grant/revoke)"
complete -c pg_restore -s 1 -l single-transaction -d "Restore as a single transaction"
complete -c pg_restore -l disable-triggers -d "Disable triggers during data-only restore"
complete -c pg_restore -l enable-row-security -d "Enable row security"
complete -c pg_restore -l if-exists -d "Use IF EXISTS when dropping objects"
complete -c pg_restore -l no-comments -d "Do not restore comments"
complete -c pg_restore -l no-data-for-failed-tables -d "Do not restore data of tables that could not be created"
complete -c pg_restore -l no-publications -d "Do not restore publications"
complete -c pg_restore -l no-security-labels -d "Do not restore security labels"
complete -c pg_restore -l no-subscriptions -d "Do not restore subscriptions"
complete -c pg_restore -l no-tablespaces -d "Do not restore tablespace assignments"
complete -c pg_restore -l section -x -d "Restore named section (pre-data, data, or post-data)"
complete -c pg_restore -l strict-names -d "Require table and/or schema include patterns to match at least one entity each"
complete -c pg_restore -l use-set-session-authorization -d "Use SET SESSION AUTHORIZATION commands instead of ALTER OWNER commands to set ownership"

# Connection options:
complete -c pg_restore -s h -l host -x -a '(__fish_print_hostnames)' -d "Database server host or socket directory"
complete -c pg_restore -s p -l port -x -d "Database server port number"
complete -c pg_restore -s U -l username -x -a '(__fish_complete_pg_user)' -d "Connect as specified database user"
complete -c pg_restore -s w -l no-password -d "Never prompt for password"
complete -c pg_restore -s W -l password -d "Force password prompt (should happen automatically)"
complete -c pg_restore -l role -x -d "Do SET ROLE before restore"
Loading