OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 import 'package:args/args.dart'; | 5 import 'package:args/args.dart'; |
6 import 'package:args/command_runner.dart'; | 6 import 'package:args/command_runner.dart'; |
7 | 7 |
8 import 'entrypoint.dart'; | 8 import 'entrypoint.dart'; |
9 import 'log.dart' as log; | 9 import 'log.dart' as log; |
10 import 'global_packages.dart'; | 10 import 'global_packages.dart'; |
(...skipping 19 matching lines...) Expand all Loading... |
30 } | 30 } |
31 GlobalPackages _globals; | 31 GlobalPackages _globals; |
32 | 32 |
33 /// Gets the [Entrypoint] package for the current working directory. | 33 /// Gets the [Entrypoint] package for the current working directory. |
34 /// | 34 /// |
35 /// This will load the pubspec and fail with an error if the current directory | 35 /// This will load the pubspec and fail with an error if the current directory |
36 /// is not a package. | 36 /// is not a package. |
37 Entrypoint get entrypoint { | 37 Entrypoint get entrypoint { |
38 // Lazy load it. | 38 // Lazy load it. |
39 if (_entrypoint == null) { | 39 if (_entrypoint == null) { |
40 _entrypoint = new Entrypoint('.', cache, | 40 _entrypoint = new Entrypoint('.', cache); |
41 packageSymlinks: globalResults['package-symlinks']); | |
42 } | 41 } |
43 return _entrypoint; | 42 return _entrypoint; |
44 } | 43 } |
45 Entrypoint _entrypoint; | 44 Entrypoint _entrypoint; |
46 | 45 |
47 /// The URL for web documentation for this command. | 46 /// The URL for web documentation for this command. |
48 String get docUrl => null; | 47 String get docUrl => null; |
49 | 48 |
50 /// Override this and return `false` to disallow trailing options from being | 49 /// Override this and return `false` to disallow trailing options from being |
51 /// parsed after a non-option argument is parsed. | 50 /// parsed after a non-option argument is parsed. |
(...skipping 29 matching lines...) Expand all Loading... |
81 /// If the parsing fails, prints a usage message and exits. | 80 /// If the parsing fails, prints a usage message and exits. |
82 int parseInt(String intString, String name) { | 81 int parseInt(String intString, String name) { |
83 try { | 82 try { |
84 return int.parse(intString); | 83 return int.parse(intString); |
85 } on FormatException catch (_) { | 84 } on FormatException catch (_) { |
86 usageException('Could not parse $name "$intString".'); | 85 usageException('Could not parse $name "$intString".'); |
87 return null; | 86 return null; |
88 } | 87 } |
89 } | 88 } |
90 } | 89 } |
OLD | NEW |