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 library pub.command; | |
6 | |
7 import 'package:args/args.dart'; | 5 import 'package:args/args.dart'; |
8 import 'package:args/command_runner.dart'; | 6 import 'package:args/command_runner.dart'; |
9 | 7 |
10 import 'entrypoint.dart'; | 8 import 'entrypoint.dart'; |
11 import 'log.dart' as log; | 9 import 'log.dart' as log; |
12 import 'global_packages.dart'; | 10 import 'global_packages.dart'; |
13 import 'system_cache.dart'; | 11 import 'system_cache.dart'; |
14 | 12 |
15 /// The base class for commands for the pub executable. | 13 /// The base class for commands for the pub executable. |
16 /// | 14 /// |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 /// | 82 /// |
85 /// If the parsing fails, prints a usage message and exits. | 83 /// If the parsing fails, prints a usage message and exits. |
86 int parseInt(String intString, String name) { | 84 int parseInt(String intString, String name) { |
87 try { | 85 try { |
88 return int.parse(intString); | 86 return int.parse(intString); |
89 } on FormatException catch (_) { | 87 } on FormatException catch (_) { |
90 usageException('Could not parse $name "$intString".'); | 88 usageException('Could not parse $name "$intString".'); |
91 } | 89 } |
92 } | 90 } |
93 } | 91 } |
OLD | NEW |