Skip to content

Commit 8566843

Browse files
committed
Updating README.md with latest command output for --help and \?
1 parent cc876a6 commit 8566843

File tree

1 file changed

+34
-35
lines changed

1 file changed

+34
-35
lines changed

README.md

+34-35
Original file line numberDiff line numberDiff line change
@@ -376,42 +376,39 @@ $ usql pg://localhost/ -f script.sql
376376
Supported command-line options:
377377

378378
```sh
379-
$ usql --help
380-
usql, the universal command-line interface for SQL databases
381-
382379
Usage:
383-
usql [OPTIONS]... [DSN]
380+
usql [flags]... [DSN]
384381

385382
Arguments:
386-
DSN database url
387-
388-
Options:
389-
-c, --command=COMMAND ... run only single command (SQL or internal) and exit
390-
-f, --file=FILE ... execute commands from file and exit
391-
-w, --no-password never prompt for password
392-
-X, --no-rc do not read start up file
393-
-o, --out=OUT output file
394-
-W, --password force password prompt (should happen automatically)
395-
-1, --single-transaction execute as a single transaction (if non-interactive)
396-
-v, --set=, --variable=NAME=VALUE ...
397-
set variable NAME to VALUE
398-
-P, --pset=VAR[=ARG] ... set printing option VAR to ARG (see \pset command)
399-
-F, --field-separator=FIELD-SEPARATOR ...
400-
field separator for unaligned output (default, "|")
401-
-R, --record-separator=RECORD-SEPARATOR ...
402-
record separator for unaligned output (default, \n)
403-
-T, --table-attr=TABLE-ATTR ...
404-
set HTML table tag attributes (e.g., width, border)
405-
-A, --no-align unaligned table output mode
406-
-H, --html HTML table output mode
407-
-t, --tuples-only print rows only
408-
-x, --expanded turn on expanded table output
409-
-z, --field-separator-zero set field separator for unaligned output to zero byte
410-
-0, --record-separator-zero set record separator for unaligned output to zero byte
411-
-J, --json JSON output mode
412-
-C, --csv CSV output mode
413-
-G, --vertical vertical output mode
414-
-V, --version display version and exit
383+
DSN database url or connection name
384+
385+
Flags:
386+
-c, --command COMMAND run only single command (SQL or internal) and exit
387+
-f, --file FILE execute commands from file and exit
388+
-w, --no-password never prompt for password
389+
-X, --no-rc do not read start up file (aliases: --no-psqlrc --no-usqlrc)
390+
-o, --out FILE output file
391+
-W, --password force password prompt (should happen automatically)
392+
-1, --single-transaction execute as a single transaction (if non-interactive)
393+
-v, --set NAME=VALUE set variable NAME to VALUE (see \set command, aliases: --var --variable)
394+
-N, --cset NAME=DSN set named connection NAME to DSN (see \cset command)
395+
-P, --pset VAR=ARG set printing option VAR to ARG (see \pset command)
396+
-F, --field-separator FIELD-SEPARATOR field separator for unaligned and CSV output (default "|" and ",")
397+
-R, --record-separator RECORD-SEPARATOR record separator for unaligned and CSV output (default \n)
398+
-T, --table-attr TABLE-ATTR set HTML table tag attributes (e.g., width, border)
399+
-A, --no-align unaligned table output mode
400+
-H, --html HTML table output mode
401+
-t, --tuples-only print rows only
402+
-x, --expanded turn on expanded table output
403+
-z, --field-separator-zero set field separator for unaligned and CSV output to zero byte
404+
-0, --record-separator-zero set record separator for unaligned and CSV output to zero byte
405+
-J, --json JSON output mode
406+
-C, --csv CSV output mode
407+
-G, --vertical vertical output mode
408+
-q, --quiet run quietly (no messages, only query output)
409+
--config string config file
410+
-V, --version output version information, then exit
411+
-?, --help show this help, then exit
415412
```
416413

417414
### Connecting to Databases
@@ -638,14 +635,14 @@ General
638635
\drivers display information about available database drivers
639636
640637
Query Execute
641-
\bind [PARAM]... set query parameters
642638
\g [(OPTIONS)] [FILE] or ; execute query (and send results to file or |pipe)
643639
\crosstabview [(OPTIONS)] [COLUMNS] execute query and display results in crosstab
644640
\G [(OPTIONS)] [FILE] as \g, but forces vertical output mode
645641
\gexec execute query and execute each value of the result
646642
\gset [PREFIX] execute query and store results in usql variables
647643
\gx [(OPTIONS)] [FILE] as \g, but forces expanded output mode
648644
\watch [(OPTIONS)] [DURATION] execute query every specified interval
645+
\bind [PARAM]... set query parameters
649646
650647
Query Buffer
651648
\e [FILE] [LINE] edit the query buffer (or file) with external editor
@@ -702,14 +699,16 @@ Transaction
702699
Connection
703700
\c DSN connect to database url
704701
\c DRIVER PARAMS... connect to database with driver and parameters
702+
\cset [NAME [DSN]] set named connection, or list all if no parameters
703+
\cset NAME DRIVER PARAMS... define named connection for database driver
705704
\Z close database connection
706705
\password [USERNAME] change the password for a user
707706
\conninfo display information about the current database connection
708707
709708
Operating System
710709
\cd [DIR] change the current working directory
711-
\setenv NAME [VALUE] set or unset environment variable
712710
\getenv VARNAME ENVVAR fetch environment variable
711+
\setenv NAME [VALUE] set or unset environment variable
713712
\! [COMMAND] execute command in shell or start interactive shell
714713
\timing [on|off] toggle timing of commands
715714

0 commit comments

Comments
 (0)