| 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; | 5 library pub.command; |
| 6 | 6 |
| 7 import 'package:args/args.dart'; | 7 import 'package:args/args.dart'; |
| 8 import 'package:args/command_runner.dart'; | 8 import 'package:args/command_runner.dart'; |
| 9 import 'package:path/path.dart' as path; | |
| 10 | 9 |
| 11 import 'entrypoint.dart'; | 10 import 'entrypoint.dart'; |
| 12 import 'log.dart' as log; | 11 import 'log.dart' as log; |
| 13 import 'global_packages.dart'; | 12 import 'global_packages.dart'; |
| 14 import 'system_cache.dart'; | 13 import 'system_cache.dart'; |
| 15 | 14 |
| 16 /// The base class for commands for the pub executable. | 15 /// The base class for commands for the pub executable. |
| 17 /// | 16 /// |
| 18 /// A command may either be a "leaf" command or it may be a parent for a set | 17 /// A command may either be a "leaf" command or it may be a parent for a set |
| 19 /// of subcommands. Only leaf commands are ever actually invoked. If a command | 18 /// of subcommands. Only leaf commands are ever actually invoked. If a command |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 /// | 84 /// |
| 86 /// If the parsing fails, prints a usage message and exits. | 85 /// If the parsing fails, prints a usage message and exits. |
| 87 int parseInt(String intString, String name) { | 86 int parseInt(String intString, String name) { |
| 88 try { | 87 try { |
| 89 return int.parse(intString); | 88 return int.parse(intString); |
| 90 } on FormatException catch (_) { | 89 } on FormatException catch (_) { |
| 91 usageException('Could not parse $name "$intString".'); | 90 usageException('Could not parse $name "$intString".'); |
| 92 } | 91 } |
| 93 } | 92 } |
| 94 } | 93 } |
| OLD | NEW |