@@ -174,10 +174,11 @@ function shouldBePretty(sys: System, options: CompilerOptions | BuildOptions) {
174174}
175175
176176function getOptionsForHelp ( commandLine : ParsedCommandLine ) {
177+ const helpOptions = filter ( optionDeclarations . concat ( tscBuildOption ) , option => option . showInHelp !== false ) ;
177178 // Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
178179 return ! ! commandLine . options . all ?
179- toSorted ( optionDeclarations . concat ( tscBuildOption ) , ( a , b ) => compareStringsCaseInsensitive ( a . name , b . name ) ) :
180- filter ( optionDeclarations . concat ( tscBuildOption ) , v => ! ! v . showInSimplifiedHelpView ) ;
180+ toSorted ( helpOptions , ( a , b ) => compareStringsCaseInsensitive ( a . name , b . name ) ) :
181+ filter ( helpOptions , v => ! ! v . showInSimplifiedHelpView ) ;
181182}
182183
183184function printVersion ( sys : System ) {
@@ -512,16 +513,16 @@ function printEasyHelp(sys: System, simpleOptions: readonly CommandLineOption[])
512513function printAllHelp ( sys : System , compilerOptions : readonly CommandLineOption [ ] , buildOptions : readonly CommandLineOption [ ] , watchOptions : readonly CommandLineOption [ ] ) {
513514 let output : string [ ] = [ ...getHeader ( sys , `${ getDiagnosticText ( Diagnostics . tsc_Colon_The_TypeScript_Compiler ) } - ${ getDiagnosticText ( Diagnostics . Version_0 , version ) } ` ) ] ;
514515 output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . ALL_COMPILER_OPTIONS ) , compilerOptions , /*subCategory*/ true , /*beforeOptionsDescription*/ undefined , formatMessage ( Diagnostics . You_can_learn_about_all_of_the_compiler_options_at_0 , "https://aka.ms/tsc" ) ) ] ;
515- output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . WATCH_OPTIONS ) , watchOptions , /*subCategory*/ false , getDiagnosticText ( Diagnostics . Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon ) ) ] ;
516- output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . BUILD_OPTIONS ) , filter ( buildOptions , option => option !== tscBuildOption ) , /*subCategory*/ false , formatMessage ( Diagnostics . Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0 , "https://aka.ms/tsc-composite-builds" ) ) ] ;
516+ output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . WATCH_OPTIONS ) , filter ( watchOptions , option => option . showInHelp !== false ) , /*subCategory*/ false , getDiagnosticText ( Diagnostics . Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon ) ) ] ;
517+ output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . BUILD_OPTIONS ) , filter ( buildOptions , option => option !== tscBuildOption && option . showInHelp !== false ) , /*subCategory*/ false , formatMessage ( Diagnostics . Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0 , "https://aka.ms/tsc-composite-builds" ) ) ] ;
517518 for ( const line of output ) {
518519 sys . write ( line ) ;
519520 }
520521}
521522
522523function printBuildHelp ( sys : System , buildOptions : readonly CommandLineOption [ ] ) {
523524 let output : string [ ] = [ ...getHeader ( sys , `${ getDiagnosticText ( Diagnostics . tsc_Colon_The_TypeScript_Compiler ) } - ${ getDiagnosticText ( Diagnostics . Version_0 , version ) } ` ) ] ;
524- output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . BUILD_OPTIONS ) , filter ( buildOptions , option => option !== tscBuildOption ) , /*subCategory*/ false , formatMessage ( Diagnostics . Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0 , "https://aka.ms/tsc-composite-builds" ) ) ] ;
525+ output = [ ...output , ...generateSectionOptionsOutput ( sys , getDiagnosticText ( Diagnostics . BUILD_OPTIONS ) , filter ( buildOptions , option => option !== tscBuildOption && option . showInHelp !== false ) , /*subCategory*/ false , formatMessage ( Diagnostics . Using_build_b_will_make_tsc_behave_more_like_a_build_orchestrator_than_a_compiler_This_is_used_to_trigger_building_composite_projects_which_you_can_learn_more_about_at_0 , "https://aka.ms/tsc-composite-builds" ) ) ] ;
525526 for ( const line of output ) {
526527 sys . write ( line ) ;
527528 }
0 commit comments