Chromium Code Reviews| Index: pkg/analysis_server/benchmark/integration/main.dart |
| diff --git a/pkg/analysis_server/benchmark/integration/main.dart b/pkg/analysis_server/benchmark/integration/main.dart |
| index 979f25659714968e660d86db176e230a481c0573..d0527edd64f5b335db4743c1cd85c0051376aa77 100644 |
| --- a/pkg/analysis_server/benchmark/integration/main.dart |
| +++ b/pkg/analysis_server/benchmark/integration/main.dart |
| @@ -1,4 +1,5 @@ |
| // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| + |
|
Brian Wilkerson
2015/07/24 13:18:21
???
danrubel
2015/08/03 13:26:09
Not sure how/when this blank line got added. Remov
|
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| @@ -69,6 +70,43 @@ const TMP_SRC_DIR_OPTION = 'tmpSrcDir'; |
| const VERBOSE_CMDLINE_OPTION = 'verbose'; |
| const VERY_VERBOSE_CMDLINE_OPTION = 'vv'; |
| +ArgParser _argParser; |
| + |
| +ArgParser get argParser { |
| + _argParser = new ArgParser(); |
| + |
| + _argParser.addOption(INPUT_CMDLINE_OPTION, abbr: 'i', help: '<filePath>\n' |
| + 'The input file specifying how this client should interact with the server.\n' |
| + 'If the input file name is "stdin", then the instructions are read from standard input.'); |
| + _argParser.addOption(MAP_OPTION, |
| + abbr: 'm', |
| + allowMultiple: true, |
| + splitCommas: false, |
| + help: '<oldSrcPath>,<newSrcPath>\n' |
| + 'This option defines a mapping from the original source directory <oldSrcPath>\n' |
| + 'when the instrumentation or log file was generated\n' |
| + 'to the target source directory <newSrcPath> used during performance testing.\n' |
| + 'Multiple mappings can be specified.\n' |
| + 'WARNING: The contents of the target directory will be modified'); |
| + _argParser.addOption(TMP_SRC_DIR_OPTION, abbr: 't', help: '<dirPath>\n' |
| + 'The temporary directory containing source used during performance measurement.\n' |
| + 'WARNING: The contents of the target directory will be modified'); |
| + _argParser.addFlag(NEW_TASK_MODEL_OPTION, |
| + help: "enable the use of the new task model", |
| + defaultsTo: false, |
| + negatable: false); |
| + _argParser.addOption(DIAGNOSTIC_PORT_OPTION, |
| + abbr: 'd', |
| + help: 'localhost port on which server will provide diagnostic web pages'); |
| + _argParser.addFlag(VERBOSE_CMDLINE_OPTION, |
| + abbr: 'v', help: 'Verbose logging', negatable: false); |
| + _argParser.addFlag(VERY_VERBOSE_CMDLINE_OPTION, |
| + help: 'Extra verbose logging', negatable: false); |
| + _argParser.addFlag(HELP_CMDLINE_OPTION, |
| + abbr: 'h', help: 'Print this help information', negatable: false); |
| + return _argParser; |
| +} |
| + |
| /** |
| * Open and return the input stream specifying how this client |
| * should interact with the analysis server. |
| @@ -96,45 +134,13 @@ Stream<Operation> openInput(PerfArgs args) { |
| * Parse the command line arguments. |
| */ |
| PerfArgs parseArgs(List<String> rawArgs) { |
| - ArgParser parser = new ArgParser(); |
| - |
| - parser.addOption(INPUT_CMDLINE_OPTION, abbr: 'i', help: '<filePath>\n' |
| - 'The input file specifying how this client should interact with the server.\n' |
| - 'If the input file name is "stdin", then the instructions are read from standard input.'); |
| - parser.addOption(MAP_OPTION, |
| - abbr: 'm', |
| - allowMultiple: true, |
| - splitCommas: false, |
| - help: '<oldSrcPath>,<newSrcPath>\n' |
| - 'This option defines a mapping from the original source directory <oldSrcPath>\n' |
| - 'when the instrumentation or log file was generated\n' |
| - 'to the target source directory <newSrcPath> used during performance testing.\n' |
| - 'Multiple mappings can be specified.\n' |
| - 'WARNING: The contents of the target directory will be modified'); |
| - parser.addOption(TMP_SRC_DIR_OPTION, abbr: 't', help: '<dirPath>\n' |
| - 'The temporary directory containing source used during performance measurement.\n' |
| - 'WARNING: The contents of the target directory will be modified'); |
| - parser.addFlag(NEW_TASK_MODEL_OPTION, |
| - help: "enable the use of the new task model", |
| - defaultsTo: false, |
| - negatable: false); |
| - parser.addOption(DIAGNOSTIC_PORT_OPTION, |
| - abbr: 'd', |
| - help: 'localhost port on which server will provide diagnostic web pages'); |
| - parser.addFlag(VERBOSE_CMDLINE_OPTION, |
| - abbr: 'v', help: 'Verbose logging', negatable: false); |
| - parser.addFlag(VERY_VERBOSE_CMDLINE_OPTION, |
| - help: 'Extra verbose logging', negatable: false); |
| - parser.addFlag(HELP_CMDLINE_OPTION, |
| - abbr: 'h', help: 'Print this help information', negatable: false); |
| - |
| ArgResults args; |
| PerfArgs perfArgs = new PerfArgs(); |
| try { |
| - args = parser.parse(rawArgs); |
| + args = argParser.parse(rawArgs); |
| } on Exception catch (e) { |
| print(e); |
| - printHelp(parser); |
| + printHelp(); |
| exit(1); |
| } |
| @@ -189,18 +195,18 @@ PerfArgs parseArgs(List<String> rawArgs) { |
| } |
| if (showHelp) { |
| - printHelp(parser); |
| + printHelp(); |
| exit(1); |
| } |
| return perfArgs; |
| } |
| -void printHelp(ArgParser parser) { |
| +void printHelp() { |
| print(''); |
| print('Launch and interact with the AnalysisServer'); |
| print(''); |
| - print(parser.usage); |
| + print(argParser.usage); |
| } |
| /** |