| 40 | } |
| 41 | |
| 42 | func 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 | |
| 63 | func ParseBuildCommandLine( |
| 64 | commandLine []string, |