@@ -19,7 +19,7 @@ func PrintHelp(sys System, commandLine *tsoptions.ParsedCommandLine) {
1919 if commandLine .CompilerOptions ().All .IsFalseOrUnknown () {
2020 printEasyHelp (sys , getOptionsForHelp (commandLine ))
2121 } else {
22- // !!! printAllHelp(sys, getOptionsForHelp(commandLine))
22+ printAllHelp (sys , getOptionsForHelp (commandLine ))
2323 }
2424}
2525
@@ -107,6 +107,31 @@ func printEasyHelp(sys System, simpleOptions []*tsoptions.CommandLineOption) {
107107 }
108108}
109109
110+ func printAllHelp (sys System , options []* tsoptions.CommandLineOption ) {
111+ var output []string
112+ msg := diagnostics .X_tsc_Colon_The_TypeScript_Compiler .Format () + " - " + diagnostics .Version_0 .Format (core .Version ())
113+ output = append (output , getHeader (sys , msg )... )
114+
115+ // ALL COMPILER OPTIONS section
116+ afterCompilerOptions := diagnostics .You_can_learn_about_all_of_the_compiler_options_at_0 .Format ("https://aka.ms/tsc" )
117+ output = append (output , generateSectionOptionsOutput (sys , diagnostics .ALL_COMPILER_OPTIONS .Format (), options , true , nil , & afterCompilerOptions )... )
118+
119+ // WATCH OPTIONS section
120+ beforeWatchOptions := diagnostics .Including_watch_w_will_start_watching_the_current_project_for_the_file_changes_Once_set_you_can_config_watch_mode_with_Colon .Format ()
121+ output = append (output , generateSectionOptionsOutput (sys , diagnostics .WATCH_OPTIONS .Format (), tsoptions .OptionsForWatch , false , & beforeWatchOptions , nil )... )
122+
123+ // BUILD OPTIONS section
124+ beforeBuildOptions := 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 .Format ("https://aka.ms/tsc-composite-builds" )
125+ buildOptions := core .Filter (tsoptions .OptionsForBuild , func (option * tsoptions.CommandLineOption ) bool {
126+ return option != & tsoptions .TscBuildOption
127+ })
128+ output = append (output , generateSectionOptionsOutput (sys , diagnostics .BUILD_OPTIONS .Format (), buildOptions , false , & beforeBuildOptions , nil )... )
129+
130+ for _ , chunk := range output {
131+ fmt .Fprint (sys .Writer (), chunk )
132+ }
133+ }
134+
110135func PrintBuildHelp (sys System , buildOptions []* tsoptions.CommandLineOption ) {
111136 var output []string
112137 output = append (output , getHeader (sys , diagnostics .X_tsc_Colon_The_TypeScript_Compiler .Format ()+ " - " + diagnostics .Version_0 .Format (core .Version ()))... )
@@ -142,14 +167,19 @@ func generateSectionOptionsOutput(
142167 return output
143168 }
144169 categoryMap := make (map [string ][]* tsoptions.CommandLineOption )
170+ var categoryOrder []string
145171 for _ , option := range options {
146172 if option .Category == nil {
147173 continue
148174 }
149175 curCategory := option .Category .Format ()
176+ if _ , exists := categoryMap [curCategory ]; ! exists {
177+ categoryOrder = append (categoryOrder , curCategory )
178+ }
150179 categoryMap [curCategory ] = append (categoryMap [curCategory ], option )
151180 }
152- for key , value := range categoryMap {
181+ for _ , key := range categoryOrder {
182+ value := categoryMap [key ]
153183 output = append (output , "### " , key , "\n " , "\n " )
154184 output = append (output , generateGroupOptionOutput (sys , value )... )
155185 }
0 commit comments