forked from withfig/autocomplete
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpyenv.ts
149 lines (148 loc) · 3.49 KB
/
pyenv.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
140
141
142
143
144
145
146
147
148
149
const versionList: Fig.Generator = {
script: "pyenv install -l",
postProcess: function (out) {
const lines = out.split("\n");
const versionList = [];
for (let i = 1; i < lines.length; i++) {
versionList.push({
name: lines[i],
icon: "🐍",
});
}
return versionList;
},
};
export const completionSpec: Fig.Spec = {
name: "pyenv",
description: "pyenv",
args: {},
options: [
{
name: ["-h", "--help"],
description: "Output usage information",
},
],
subcommands: [
{
name: "commands",
description: "Lists all available pyenv commands.",
},
{
name: "local",
description: "Sets a local application-specific Python version",
args: {
name: "python version",
variadic: true,
},
options: [
{
name: ["--unset"],
},
],
},
{
name: "global",
description: "Sets the global version of Python to be used in all shells",
args: {
name: "python version",
},
},
{
name: "shell",
description: "Sets a shell-specific Python version",
args: {
name: "python version",
},
options: [
{
name: ["--unset"],
},
],
},
{
name: "install",
description: "Install a Python version",
args: {
name: "python version",
generators: versionList,
},
options: [
{
name: ["-l", "--list"],
description: "List all available versions",
},
{
name: ["-f", "--force"],
description:
"Install even if the version appears to be installed already",
},
{
name: ["-s", "--skip-existing"],
description:
"Skip the installation if the version appears to be installed already",
},
{
name: ["-k", "--keep"],
description:
"Keep source tree in $PYENV_BUILD_ROOT after installation",
},
{
name: ["-v", "--verbose"],
description: "Verbose mode: print compilation status to stdout",
},
{
name: ["-p", "--patch"],
description: "Apply a patch from stdin before building",
},
{
name: ["-g", "--debug"],
description: "Build a debug version",
},
],
},
{
name: "uninstall",
description: "Performs a deployment (default)",
args: {
name: "version",
},
options: [
{
name: ["-f", "--force"],
description:
"Attempt to remove the specified version without prompting for confirmation.",
},
],
},
{
name: "rehash",
description: "Performs a deployment (default)",
},
{
name: "version",
description:
"Displays the currently active Python version, along with information on how it was set.",
},
{
name: "versions",
description:
"Lists all Python versions known to pyenv, and shows an asterisk next to the currently active version.",
},
{
name: "which",
description:
"Displays the full path to the executable that pyenv will invoke when you run the given command.",
args: {
name: "command",
},
},
{
name: "whence",
description:
"Lists all Python versions with the given command installed.",
args: {
name: "command",
},
},
],
};