@@ -14,11 +14,11 @@ import { writeFileSync } from 'vs/base/node/pfs';
1414 * This code is also used by standalone cli's. Avoid adding any other dependencies.
1515 */
1616
17- class HelpCategories {
18- o = localize ( 'optionsUpperCase' , "Options" ) ;
19- e = localize ( 'extensionsManagement' , "Extensions Management" ) ;
20- t = localize ( 'troubleshooting' , "Troubleshooting" ) ;
21- }
17+ const helpCategories = {
18+ o : localize ( 'optionsUpperCase' , "Options" ) ,
19+ e : localize ( 'extensionsManagement' , "Extensions Management" ) ,
20+ t : localize ( 'troubleshooting' , "Troubleshooting" )
21+ } ;
2222
2323export interface Option {
2424 id : string ;
@@ -27,7 +27,7 @@ export interface Option {
2727 deprecates ?: string ; // old deprecated id
2828 args ?: string | string [ ] ;
2929 description ?: string ;
30- cat ?: keyof HelpCategories ;
30+ cat ?: keyof typeof helpCategories ;
3131}
3232
3333export const options : Option [ ] = [
@@ -94,6 +94,7 @@ export const options: Option[] = [
9494 { id : 'trace-category-filter' , type : 'string' } ,
9595 { id : 'trace-options' , type : 'string' } ,
9696 { id : 'prof-code-loading' , type : 'boolean' } ,
97+ { id : 'js-flags' , type : 'string' } ,
9798 { id : '_' , type : 'string' }
9899] ;
99100
@@ -189,8 +190,6 @@ function wrapText(text: string, columns: number): string[] {
189190export function buildHelpMessage ( productName : string , executableName : string , version : string , isOptionSupported = ( _ : Option ) => true , isPipeSupported = true ) : string {
190191 const columns = ( process . stdout ) . isTTY && ( process . stdout ) . columns || 80 ;
191192
192- let categories = new HelpCategories ( ) ;
193-
194193 let help = [ `${ productName } ${ version } ` ] ;
195194 help . push ( '' ) ;
196195 help . push ( `${ localize ( 'usage' , "Usage" ) } : ${ executableName } [${ localize ( 'options' , "options" ) } ][${ localize ( 'paths' , 'paths' ) } ...]` ) ;
@@ -203,10 +202,12 @@ export function buildHelpMessage(productName: string, executableName: string, ve
203202 }
204203 help . push ( '' ) ;
205204 }
206- for ( const key in categories ) {
205+ for ( let helpCategoryKey in helpCategories ) {
206+ const key = < keyof typeof helpCategories > helpCategoryKey ;
207+
207208 let categoryOptions = options . filter ( o => ! ! o . description && o . cat === key && isOptionSupported ( o ) ) ;
208209 if ( categoryOptions . length ) {
209- help . push ( categories [ key as keyof HelpCategories ] ) ;
210+ help . push ( helpCategories [ key ] ) ;
210211 help . push ( ...formatOptions ( categoryOptions , columns ) ) ;
211212 help . push ( '' ) ;
212213 }
0 commit comments