未验证 提交 88b8cff8 编写于 作者: A Anmol Sethi 提交者: GitHub

Merge pull request #2427 from cdr/link-docs-0cc3

cli: Show beta flags in help output
...@@ -33,10 +33,10 @@ When done, the install script prints out instructions for running and starting c ...@@ -33,10 +33,10 @@ When done, the install script prints out instructions for running and starting c
We also have an in-depth [setup and configuration](./doc/guide.md) guide. We also have an in-depth [setup and configuration](./doc/guide.md) guide.
### Alpha Program 🐣 ### Cloud Program ☁️
We're working on a cloud platform that makes deploying and managing code-server easier. We're working on a cloud platform that makes deploying and managing code-server easier.
Consider updating to the latest version and running code-server with our experimental flag `--link` if you don't want to worry about Consider running code-server with the beta flag `--link` if you don't want to worry about
- TLS - TLS
- Authentication - Authentication
......
...@@ -74,7 +74,7 @@ interface Option<T> { ...@@ -74,7 +74,7 @@ interface Option<T> {
description?: string description?: string
/** /**
* If marked as beta, the option is not printed unless $CS_BETA is set. * If marked as beta, the option is marked as beta in help.
*/ */
beta?: boolean beta?: boolean
} }
...@@ -193,8 +193,6 @@ const options: Options<Required<Args>> = { ...@@ -193,8 +193,6 @@ const options: Options<Required<Args>> = {
Securely bind code-server via Coder Cloud with the passed name. You'll get a URL like 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. https://myname.coder-cloud.com at which you can easily access your code-server instance.
Authorization is done via GitHub. Authorization is done via GitHub.
This is presently beta and requires being accepted for testing.
See https://github.com/cdr/code-server/discussions/2137
`, `,
beta: true, beta: true,
}, },
...@@ -209,32 +207,24 @@ export const optionDescriptions = (): string[] => { ...@@ -209,32 +207,24 @@ export const optionDescriptions = (): string[] => {
}), }),
{ short: 0, long: 0 }, { short: 0, long: 0 },
) )
return entries return entries.map(([k, v]) => {
.filter(([, v]) => { const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${v.short ? `-${v.short}` : " "} --${k} `
// If CS_BETA is set, we show beta options but if not, then we do not want return (
// to show beta options. help +
return process.env.CS_BETA || !v.beta v.description
}) ?.trim()
.map(([k, v]) => { .split(/\n/)
const help = `${" ".repeat(widths.short - (v.short ? v.short.length : 0))}${ .map((line, i) => {
v.short ? `-${v.short}` : " " line = line.trim()
} --${k} ` if (i === 0) {
return ( return " ".repeat(widths.long - k.length) + (v.beta ? "(beta) " : "") + line
help + }
v.description return " ".repeat(widths.long + widths.short + 6) + line
?.trim() })
.split(/\n/) .join("\n") +
.map((line, i) => { (typeof v.type === "object" ? ` [${Object.values(v.type).join(", ")}]` : "")
line = line.trim() )
if (i === 0) { })
return " ".repeat(widths.long - k.length) + line
}
return " ".repeat(widths.long + widths.short + 6) + line
})
.join("\n") +
(typeof v.type === "object" ? ` [${Object.values(v.type).join(", ")}]` : "")
)
})
} }
export const parse = ( export const parse = (
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册