MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getOptionsForHelp

Function getOptionsForHelp

internal/execute/tsc/help.go:27–42  ·  view source on GitHub ↗
(commandLine *tsoptions.ParsedCommandLine)

Source from the content-addressed store, hash-verified

25}
26
27func getOptionsForHelp(commandLine *tsoptions.ParsedCommandLine) []*tsoptions.CommandLineOption {
28 // Sort our options by their names, (e.g. "--noImplicitAny" comes before "--watch")
29 opts := slices.Clone(tsoptions.OptionsDeclarations)
30 opts = append(opts, &tsoptions.TscBuildOption)
31
32 if commandLine.CompilerOptions().All.IsTrue() {
33 slices.SortFunc(opts, func(a, b *tsoptions.CommandLineOption) int {
34 return strings.Compare(strings.ToLower(a.Name), strings.ToLower(b.Name))
35 })
36 return opts
37 } else {
38 return core.Filter(opts, func(opt *tsoptions.CommandLineOption) bool {
39 return opt.ShowInSimplifiedHelpView
40 })
41 }
42}
43
44func getHeader(sys System, message string) []string {
45 colors := createColors(sys)

Callers 1

PrintHelpFunction · 0.85

Calls 6

FilterFunction · 0.92
IsTrueMethod · 0.80
CloneMethod · 0.65
CompilerOptionsMethod · 0.65
appendFunction · 0.50
CompareMethod · 0.45

Tested by

no test coverage detected