Skip to content

Commit 88b8cff

Browse files
authored
Merge pull request #2427 from cdr/link-docs-0cc3
cli: Show beta flags in help output
2 parents 9efdec8 + affb92f commit 88b8cff

File tree

2 files changed

+21
-31
lines changed

2 files changed

+21
-31
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ When done, the install script prints out instructions for running and starting c
3333

3434
We also have an in-depth [setup and configuration](./doc/guide.md) guide.
3535

36-
### Alpha Program 🐣
36+
### Cloud Program ☁️
3737

3838
We're working on a cloud platform that makes deploying and managing code-server easier.
39-
Consider updating to the latest version and running code-server with our experimental flag `--link` if you don't want to worry about
39+
Consider running code-server with the beta flag `--link` if you don't want to worry about
4040

4141
- TLS
4242
- Authentication

src/node/cli.ts

+19-29
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ interface Option<T> {
7474
description?: string
7575

7676
/**
77-
* If marked as beta, the option is not printed unless $CS_BETA is set.
77+
* If marked as beta, the option is marked as beta in help.
7878
*/
7979
beta?: boolean
8080
}
@@ -193,8 +193,6 @@ const options: Options<Required<Args>> = {
193193
Securely bind code-server via Coder Cloud with the passed name. You'll get a URL like
194194
https://myname.coder-cloud.com at which you can easily access your code-server instance.
195195
Authorization is done via GitHub.
196-
This is presently beta and requires being accepted for testing.
197-
See https://github.com/cdr/code-server/discussions/2137
198196
`,
199197
beta: true,
200198
},
@@ -209,32 +207,24 @@ export const optionDescriptions = (): string[] => {
209207
}),
210208
{ short: 0, long: 0 },
211209
)
212-
return entries
213-
.filter(([, v]) => {
214-
// If CS_BETA is set, we show beta options but if not, then we do not want
215-
// to show beta options.
216-
return process.env.CS_BETA || !v.beta
217-
})
218-
.map(([k, v]) => {
219-
const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${
220-
v.short ? `-${v.short}` : " "
221-
} --${k} `
222-
return (
223-
help +
224-
v.description
225-
?.trim()
226-
.split(/\n/)
227-
.map((line, i) => {
228-
line = line.trim()
229-
if (i === 0) {
230-
return " ".repeat(widths.long - k.length) + line
231-
}
232-
return " ".repeat(widths.long + widths.short + 6) + line
233-
})
234-
.join("\n") +
235-
(typeof v.type === "object" ? ` [${Object.values(v.type).join(", ")}]` : "")
236-
)
237-
})
210+
return entries.map(([k, v]) => {
211+
const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${v.short ? `-${v.short}` : " "} --${k} `
212+
return (
213+
help +
214+
v.description
215+
?.trim()
216+
.split(/\n/)
217+
.map((line, i) => {
218+
line = line.trim()
219+
if (i === 0) {
220+
return " ".repeat(widths.long - k.length) + (v.beta ? "(beta) " : "") + line
221+
}
222+
return " ".repeat(widths.long + widths.short + 6) + line
223+
})
224+
.join("\n") +
225+
(typeof v.type === "object" ? ` [${Object.values(v.type).join(", ")}]` : "")
226+
)
227+
})
238228
}
239229

240230
export const parse = (

0 commit comments

Comments
 (0)