-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
/
Copy pathpgcli.ts
139 lines (138 loc) · 3.13 KB
/
pgcli.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
const completionSpec: Fig.Spec = {
name: "pgcli",
args: {
name: "database_name or db_url",
},
options: [
{
name: ["-h", "--host"],
description: "Host address of the postgres database",
args: {
name: "text",
},
},
{
name: ["-p", "--port"],
description: "Port number at which the postgres instance is listening",
args: {
name: "integer",
},
},
{
name: ["-U", "--username"],
description: "Username to connect to the postgres database",
args: {
name: "text",
},
},
{
name: ["-u", "--user"],
description: "Username to connect to the postgres database",
args: {
name: "text",
},
},
{
name: ["-W", "--password"],
description: "Force password prompt",
},
{
name: ["-w", "--no-password"],
description: "Never prompt for password",
},
{
name: "--single-connection",
description: "Do not use a separate connection for completions",
},
{
name: ["-v", "--version"],
description: "Version of pgcli",
},
{
name: ["-d", "--dbname"],
description: "Database name to connect to",
args: {
name: "text",
},
},
{
name: "--pgclirc",
description: "Location of pgclirc file",
args: {
name: "file",
template: ["filepaths"],
suggestCurrentToken: true,
},
},
{
name: ["-D", "--dsn"],
description:
"Use DSN configured into the [alias_dsn] section of pgclirc file",
args: {
name: "text",
},
},
{
name: "--list-dsn",
description:
"List of DSN configured into the [alias_dsn] section of pgclirc file",
},
{
name: "--row-limit",
description:
"Set threshold for row limit prompt. Use 0 to disable prompt",
args: {
name: "integer",
},
},
{
name: "--less-chatty",
description: "Skip intro on startup and goodbye on exit",
},
{
name: "--prompt",
description: 'Prompt format (Default: "\\u@\\h:\\d> ")',
args: {
name: "text",
},
},
{
name: "--prompt-dsn",
description:
'Prompt format for connections using DSN aliases (Default: "\\u@\\h:\\d> ")',
args: {
name: "text",
},
},
{
name: ["-l", "--list"],
description: "List available databases, then exit",
},
{
name: "--auto-vertical-output",
description:
"Automatically switch to vertical output mode if the result is wider than the terminal width",
},
{
name: "--warn",
description: "Warn before running a destructive query",
args: {
name: "choice",
suggestions: ["all", "moderate", "off"],
},
},
{
name: "--ssh-tunnel",
description:
"Open an SSH tunnel to the given address and connect to the database from it",
args: {
name: "text",
},
},
{
name: "--help",
description: "Show this message and exit",
},
],
};
export default completionSpec;