Skip to content

Commit 6eccfef

Browse files
committed
cli: Show beta flags in help output
Looks like ``` -r --reuse-window Force to open a file or folder in an already opened window. -vvv --verbose Enable verbose logging. --link (beta) Securely bind code-server via Coder Cloud with the passed name. You'll get a URL like https://myname.coder-cloud.com at which you can easily access your code-server instance. Authorization is done via GitHub. ``` Based on commits by @JammSpread in #2405 Closes #2396
1 parent 6c69300 commit 6eccfef

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ We also have an in-depth [setup and configuration](./doc/guide.md) guide.
3636
### Cloud Program ☁️
3737

3838
We're working on a cloud platform that makes deploying and managing code-server easier.
39-
Consider running code-server with the 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

+3-7
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
}
@@ -194,6 +194,7 @@ const options: Options<Required<Args>> = {
194194
https://myname.coder-cloud.com at which you can easily access your code-server instance.
195195
Authorization is done via GitHub.
196196
`,
197+
beta: true,
197198
},
198199
}
199200

@@ -207,11 +208,6 @@ export const optionDescriptions = (): string[] => {
207208
{ short: 0, long: 0 },
208209
)
209210
return entries
210-
.filter(([, v]) => {
211-
// If CS_BETA is set, we show beta options but if not, then we do not want
212-
// to show beta options.
213-
return process.env.CS_BETA || !v.beta
214-
})
215211
.map(([k, v]) => {
216212
const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${
217213
v.short ? `-${v.short}` : " "
@@ -224,7 +220,7 @@ export const optionDescriptions = (): string[] => {
224220
.map((line, i) => {
225221
line = line.trim()
226222
if (i === 0) {
227-
return " ".repeat(widths.long - k.length) + line
223+
return " ".repeat(widths.long - k.length) + (v.beta ? "(beta) " : "") + line
228224
}
229225
return " ".repeat(widths.long + widths.short + 6) + line
230226
})

0 commit comments

Comments
 (0)