(sys System, locale locale.Locale, simpleOptions []*tsoptions.CommandLineOption)
| 65 | } |
| 66 | |
| 67 | func printEasyHelp(sys System, locale locale.Locale, simpleOptions []*tsoptions.CommandLineOption) { |
| 68 | colors := createColors(sys) |
| 69 | var output []string |
| 70 | example := func(examples []string, desc *diagnostics.Message) { |
| 71 | for _, example := range examples { |
| 72 | output = append(output, " ", colors.blue(example), "\n") |
| 73 | } |
| 74 | output = append(output, " ", desc.Localize(locale), "\n", "\n") |
| 75 | } |
| 76 | |
| 77 | msg := diagnostics.X_tsc_Colon_The_TypeScript_Compiler.Localize(locale) + " - " + diagnostics.Version_0.Localize(locale, core.Version()) |
| 78 | output = append(output, getHeader(sys, msg)...) |
| 79 | |
| 80 | output = append(output, colors.bold(diagnostics.COMMON_COMMANDS.Localize(locale)), "\n", "\n") |
| 81 | |
| 82 | example([]string{"tsc"}, diagnostics.Compiles_the_current_project_tsconfig_json_in_the_working_directory) |
| 83 | example([]string{"tsc app.ts util.ts"}, diagnostics.Ignoring_tsconfig_json_compiles_the_specified_files_with_default_compiler_options) |
| 84 | example([]string{"tsc -b"}, diagnostics.Build_a_composite_project_in_the_working_directory) |
| 85 | example([]string{"tsc --init"}, diagnostics.Creates_a_tsconfig_json_with_the_recommended_settings_in_the_working_directory) |
| 86 | example([]string{"tsc -p ./path/to/tsconfig.json"}, diagnostics.Compiles_the_TypeScript_project_located_at_the_specified_path) |
| 87 | example([]string{"tsc --help --all"}, diagnostics.An_expanded_version_of_this_information_showing_all_possible_compiler_options) |
| 88 | example([]string{"tsc --noEmit", "tsc --target esnext"}, diagnostics.Compiles_the_current_project_with_additional_settings) |
| 89 | |
| 90 | var cliCommands []*tsoptions.CommandLineOption |
| 91 | var configOpts []*tsoptions.CommandLineOption |
| 92 | for _, opt := range simpleOptions { |
| 93 | if opt.IsCommandLineOnly || opt.Category == diagnostics.Command_line_Options { |
| 94 | cliCommands = append(cliCommands, opt) |
| 95 | } else { |
| 96 | configOpts = append(configOpts, opt) |
| 97 | } |
| 98 | } |
| 99 | |
| 100 | output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.COMMAND_LINE_FLAGS.Localize(locale), cliCommands /*subCategory*/, false /*beforeOptionsDescription*/, nil /*afterOptionsDescription*/, nil)...) |
| 101 | |
| 102 | after := diagnostics.You_can_learn_about_all_of_the_compiler_options_at_0.Localize(locale, "https://aka.ms/tsc") |
| 103 | output = append(output, generateSectionOptionsOutput(sys, locale, diagnostics.COMMON_COMPILER_OPTIONS.Localize(locale), configOpts /*subCategory*/, false /*beforeOptionsDescription*/, nil, &after)...) |
| 104 | |
| 105 | for _, chunk := range output { |
| 106 | fmt.Fprint(sys.Writer(), chunk) |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | func printAllHelp(sys System, locale locale.Locale, options []*tsoptions.CommandLineOption) { |
| 111 | var output []string |
no test coverage detected