docs: function parseCommandLine(commandLine, readFile) {
          var options = {};
          var fileNames = [];
          var errors = [];
          var _a = getOptionNameMap(), optionNameMap = _a.optionNameMap, shortOptionNames = _a.shortOptionNames;
          parseStrings(commandLine);
          return {
              options: options,
              fileNames: fileNames,
              errors: errors
          };
          function parseStrings(args) {
              var i = 0;
              while (i < args.length) {
                  var s = args[i];
                  i++;
                  if (s.charCodeAt(0) === 64 /* at */) {
                      parseResponseFile(s.slice(1));
                  }
                  else if (s.charCodeAt(0) === 45 /* minus */) {
                      s = s.slice(s.charCodeAt(1) === 45 /* minus */ ? 2 : 1).toLowerCase();
                      // Try to translate short option names to their full equivalents.
                      if (s in shortOptionNames) {
                          s = shortOptionNames[s];
                      }
                      if (s in optionNameMap) {
                          var opt = optionNameMap[s];
                          if (opt.isTSConfigOnly) {
                              errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Option_0_can_only_be_specified_in_tsconfig_json_file, opt.name));
                          }
                          else {
                              // Check to see if no argument was provided (e.g. "--locale" is the last command-line argument).
                              if (!args[i] && opt.type !== "boolean") {
                                  errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Compiler_option_0_expects_an_argument, opt.name));
                              }
                              switch (opt.type) {
                                  case "number":
                                      options[opt.name] = parseInt(args[i]);
                                      i++;
                                      break;
                                  case "boolean":
                                      options[opt.name] = true;
                                      break;
                                  case "string":
                                      options[opt.name] = args[i] || "";
                                      i++;
                                      break;
                                  case "list":
                                      var result = parseListTypeOption(opt, args[i], errors);
                                      options[opt.name] = result || [];
                                      if (result) {
                                          i++;
                                      }
                                      break;
                                  // If not a primitive, the possible types are specified in what is effectively a map of options.
                                  default:
                                      options[opt.name] = parseCustomTypeOption(opt, args[i], errors);
                                      i++;
                                      break;
                              }
                          }
                      }
                      else {
                          errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unknown_compiler_option_0, s));
                      }
                  }
                  else {
                      fileNames.push(s);
                  }
              }
          }
          function parseResponseFile(fileName) {
              var text = readFile ? readFile(fileName) : ts.sys.readFile(fileName);
              if (!text) {
                  errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.File_0_not_found, fileName));
                  return;
              }
              var args = [];
              var pos = 0;
              while (true) {
                  while (pos < text.length && text.charCodeAt(pos) <= 32 /* space */)
                      pos++;
                  if (pos >= text.length)
                      break;
                  var start = pos;
                  if (text.charCodeAt(start) === 34 /* doubleQuote */) {
                      pos++;
                      while (pos < text.length && text.charCodeAt(pos) !== 34 /* doubleQuote */)
                          pos++;
                      if (pos < text.length) {
                          args.push(text.substring(start + 1, pos));
                          pos++;
                      }
                      else {
                          errors.push(ts.createCompilerDiagnostic(ts.Diagnostics.Unterminated_quoted_string_in_response_file_0, fileName));
                      }
                  }
                  else {
                      while (text.charCodeAt(pos) > 32 /* space */)
                          pos++;
                      args.push(text.substring(start, pos));
                  }
              }
              parseStrings(args);
          }
      }