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

Function ParseCommandLine

internal/tsoptions/commandlineparser.go:42–61  ·  view source on GitHub ↗
(
	commandLine []string,
	host ParseConfigHost,
)

Source from the content-addressed store, hash-verified

40}
41
42func ParseCommandLine(
43 commandLine []string,
44 host ParseConfigHost,
45) *ParsedCommandLine {
46 if commandLine == nil {
47 commandLine = []string{}
48 }
49 parser := parseCommandLineWorker(CompilerOptionsDidYouMeanDiagnostics, commandLine, host.FS(), host.GetCurrentDirectory())
50 optionsWithAbsolutePaths := convertToOptionsWithAbsolutePaths(parser.options.Clone(), CommandLineCompilerOptionsMap, host.GetCurrentDirectory())
51 compilerOptions := convertMapToOptions(optionsWithAbsolutePaths, &compilerOptionsParser{&core.CompilerOptions{}}).CompilerOptions
52 watchOptions := convertMapToOptions(optionsWithAbsolutePaths, &watchOptionsParser{&core.WatchOptions{}}).WatchOptions
53 result := NewParsedCommandLine(compilerOptions, parser.fileNames, tspath.ComparePathsOptions{
54 UseCaseSensitiveFileNames: host.FS().UseCaseSensitiveFileNames(),
55 CurrentDirectory: host.GetCurrentDirectory(),
56 })
57 result.ParsedConfig.WatchOptions = watchOptions
58 result.Errors = parser.errors
59 result.Raw = parser.options
60 return result
61}
62
63func ParseBuildCommandLine(
64 commandLine []string,

Callers 3

CommandLineFunction · 0.92

Calls 8

parseCommandLineWorkerFunction · 0.85
convertMapToOptionsFunction · 0.85
NewParsedCommandLineFunction · 0.85
FSMethod · 0.65
GetCurrentDirectoryMethod · 0.65
CloneMethod · 0.65