| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 /** | 5 /** |
| 6 * The main entrypoint for the pub command line application. | 6 * The main entrypoint for the pub command line application. |
| 7 */ | 7 */ |
| 8 library pub; | 8 library pub; |
| 9 | 9 |
| 10 import '../../pkg/args/lib/args.dart'; | 10 import '../../pkg/args/lib/args.dart'; |
| 11 import 'dart:io'; | 11 import 'dart:io'; |
| 12 import 'dart:math'; | 12 import 'dart:math'; |
| 13 import 'io.dart'; | 13 import 'io.dart'; |
| 14 import 'command_help.dart'; | 14 import 'command_help.dart'; |
| 15 import 'command_install.dart'; | 15 import 'command_install.dart'; |
| 16 import 'command_lish.dart'; |
| 16 import 'command_update.dart'; | 17 import 'command_update.dart'; |
| 17 import 'command_version.dart'; | 18 import 'command_version.dart'; |
| 18 import 'entrypoint.dart'; | 19 import 'entrypoint.dart'; |
| 19 import 'exit_codes.dart' as exit_codes; | 20 import 'exit_codes.dart' as exit_codes; |
| 20 import 'git_source.dart'; | 21 import 'git_source.dart'; |
| 21 import 'hosted_source.dart'; | 22 import 'hosted_source.dart'; |
| 22 import 'package.dart'; | 23 import 'package.dart'; |
| 23 import 'pubspec.dart'; | 24 import 'pubspec.dart'; |
| 24 import 'sdk_source.dart'; | 25 import 'sdk_source.dart'; |
| 25 import 'source.dart'; | 26 import 'source.dart'; |
| 26 import 'source_registry.dart'; | 27 import 'source_registry.dart'; |
| 27 import 'system_cache.dart'; | 28 import 'system_cache.dart'; |
| 28 import 'utils.dart'; | 29 import 'utils.dart'; |
| 29 import 'version.dart'; | 30 import 'version.dart'; |
| 30 | 31 |
| 31 Version get pubVersion => new Version(0, 0, 0); | 32 Version get pubVersion => new Version(0, 0, 0); |
| 32 | 33 |
| 33 /** | 34 /** |
| 34 * The commands that Pub understands. | 35 * The commands that Pub understands. |
| 35 */ | 36 */ |
| 36 Map<String, PubCommand> get pubCommands => { | 37 Map<String, PubCommand> get pubCommands => { |
| 37 'help': new HelpCommand(), | 38 'help': new HelpCommand(), |
| 38 'install': new InstallCommand(), | 39 'install': new InstallCommand(), |
| 40 'lish': new LishCommand(), |
| 39 'update': new UpdateCommand(), | 41 'update': new UpdateCommand(), |
| 40 'version': new VersionCommand() | 42 'version': new VersionCommand() |
| 41 }; | 43 }; |
| 42 | 44 |
| 43 /** | 45 /** |
| 44 * The parser for arguments that are global to Pub rather than specific to a | 46 * The parser for arguments that are global to Pub rather than specific to a |
| 45 * single command. | 47 * single command. |
| 46 */ | 48 */ |
| 47 ArgParser get pubArgParser { | 49 ArgParser get pubArgParser { |
| 48 var parser = new ArgParser(); | 50 var parser = new ArgParser(); |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 if (exception is HttpException || exception is HttpParserException || | 272 if (exception is HttpException || exception is HttpParserException || |
| 271 exception is SocketIOException || exception is PubHttpException) { | 273 exception is SocketIOException || exception is PubHttpException) { |
| 272 return exit_codes.UNAVAILABLE; | 274 return exit_codes.UNAVAILABLE; |
| 273 } else if (exception is FormatException) { | 275 } else if (exception is FormatException) { |
| 274 return exit_codes.DATA; | 276 return exit_codes.DATA; |
| 275 } else { | 277 } else { |
| 276 return 1; | 278 return 1; |
| 277 } | 279 } |
| 278 } | 280 } |
| 279 } | 281 } |
| OLD | NEW |