@@ -67,9 +67,9 @@ interface Option<T> {
6767 description ?: string
6868
6969 /**
70- * Whether to print this option in --help output
70+ * If marked as beta, the option is not printed unless $CS_BETA is set.
7171 */
72- hidden ?: boolean
72+ beta ?: boolean
7373}
7474
7575type OptionType < T > = T extends boolean
@@ -170,8 +170,10 @@ const options: Options<Required<Args>> = {
170170 Securely bind code-server via Coder Cloud with the passed name. You'll get a URL like
171171 https://myname.coder-cloud.com at which you can easily access your code-server instance.
172172 Authorization is done via GitHub.
173+ This is presently beta and requires being accepted for testing.
174+ See https://github.com/cdr/code-server/discussions/2137
173175 ` ,
174- hidden : true ,
176+ beta : true ,
175177 } ,
176178}
177179
@@ -184,24 +186,32 @@ export const optionDescriptions = (): string[] => {
184186 } ) ,
185187 { short : 0 , long : 0 } ,
186188 )
187- return entries . filter ( ( [ _ , v ] ) => ! v . hidden ) . map ( ( [ k , v ] ) => {
188- const help = `${ " " . repeat ( widths . short - ( v . short ? v . short . length : 0 ) ) } ${ v . short ? `-${ v . short } ` : " " } --${ k } `
189- return (
190- help +
191- v . description
192- ?. trim ( )
193- . split ( / \n / )
194- . map ( ( line , i ) => {
195- line = line . trim ( )
196- if ( i === 0 ) {
197- return " " . repeat ( widths . long - k . length ) + line
198- }
199- return " " . repeat ( widths . long + widths . short + 6 ) + line
200- } )
201- . join ( "\n" ) +
202- ( typeof v . type === "object" ? ` [${ Object . values ( v . type ) . join ( ", " ) } ]` : "" )
203- )
204- } )
189+ return entries
190+ . filter ( ( [ , v ] ) => {
191+ // If CS_BETA is set, we show beta options but if not, then we do not want
192+ // to show beta options.
193+ return process . env . CS_BETA || ! v . beta
194+ } )
195+ . map ( ( [ k , v ] ) => {
196+ const help = `${ " " . repeat ( widths . short - ( v . short ? v . short . length : 0 ) ) } ${
197+ v . short ? `-${ v . short } ` : " "
198+ } --${ k } `
199+ return (
200+ help +
201+ v . description
202+ ?. trim ( )
203+ . split ( / \n / )
204+ . map ( ( line , i ) => {
205+ line = line . trim ( )
206+ if ( i === 0 ) {
207+ return " " . repeat ( widths . long - k . length ) + line
208+ }
209+ return " " . repeat ( widths . long + widths . short + 6 ) + line
210+ } )
211+ . join ( "\n" ) +
212+ ( typeof v . type === "object" ? ` [${ Object . values ( v . type ) . join ( ", " ) } ]` : "" )
213+ )
214+ } )
205215}
206216
207217export const parse = (
0 commit comments