Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(450)

Side by Side Diff: pkg/analyzer_cli/lib/src/options.dart

Issue 1960263003: Allow zero analyzer args in build mode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | pkg/analyzer_cli/test/options_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library analyzer_cli.src.options; 5 library analyzer_cli.src.options;
6 6
7 import 'dart:io'; 7 import 'dart:io';
8 8
9 import 'package:analyzer_cli/src/driver.dart'; 9 import 'package:analyzer_cli/src/driver.dart';
10 import 'package:args/args.dart'; 10 import 'package:args/args.dart';
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 'No source files expected in the persistent worker mode.'); 501 'No source files expected in the persistent worker mode.');
502 _showUsage(parser); 502 _showUsage(parser);
503 exitHandler(15); 503 exitHandler(15);
504 return null; // Only reachable in testing. 504 return null; // Only reachable in testing.
505 } 505 }
506 } else if (results['version']) { 506 } else if (results['version']) {
507 outSink.write('$_binaryName version ${_getVersion()}'); 507 outSink.write('$_binaryName version ${_getVersion()}');
508 exitHandler(0); 508 exitHandler(0);
509 return null; // Only reachable in testing. 509 return null; // Only reachable in testing.
510 } else { 510 } else {
511 if (results.rest.isEmpty) { 511 if (results.rest.isEmpty && !results['build-mode']) {
512 _showUsage(parser); 512 _showUsage(parser);
513 exitHandler(15); 513 exitHandler(15);
514 return null; // Only reachable in testing. 514 return null; // Only reachable in testing.
515 } 515 }
516 } 516 }
517 return new CommandLineOptions._fromArgs(results, definedVariables); 517 return new CommandLineOptions._fromArgs(results, definedVariables);
518 } on FormatException catch (e) { 518 } on FormatException catch (e) {
519 errorSink.writeln(e.message); 519 errorSink.writeln(e.message);
520 _showUsage(parser); 520 _showUsage(parser);
521 exitHandler(15); 521 exitHandler(15);
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 667
668 int _getNextFlagIndex(args, i) { 668 int _getNextFlagIndex(args, i) {
669 for (; i < args.length; ++i) { 669 for (; i < args.length; ++i) {
670 if (args[i].startsWith('--')) { 670 if (args[i].startsWith('--')) {
671 return i; 671 return i;
672 } 672 }
673 } 673 }
674 return i; 674 return i;
675 } 675 }
676 } 676 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analyzer_cli/test/options_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698