| 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'); |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 } | 133 } |
| 134 | 134 |
| 135 print(''); | 135 print(''); |
| 136 print('Use "pub help [command]" for more information about a command.'); | 136 print('Use "pub help [command]" for more information about a command.'); |
| 137 } | 137 } |
| 138 | 138 |
| 139 void printVersion() { | 139 void printVersion() { |
| 140 print('Pub $pubVersion'); | 140 print('Pub $pubVersion'); |
| 141 } | 141 } |
| 142 | 142 |
| 143 class PubCommand { | 143 abstract class PubCommand { |
| 144 SystemCache cache; | 144 SystemCache cache; |
| 145 ArgResults globalOptions; | 145 ArgResults globalOptions; |
| 146 ArgResults commandOptions; | 146 ArgResults commandOptions; |
| 147 | 147 |
| 148 Entrypoint entrypoint; | 148 Entrypoint entrypoint; |
| 149 | 149 |
| 150 /** | 150 /** |
| 151 * A one-line description of this command. | 151 * A one-line description of this command. |
| 152 */ | 152 */ |
| 153 abstract String get description; | 153 abstract String get description; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 if (exception is HttpException || exception is HttpParserException || | 264 if (exception is HttpException || exception is HttpParserException || |
| 265 exception is SocketIOException || exception is PubHttpException) { | 265 exception is SocketIOException || exception is PubHttpException) { |
| 266 return exit_codes.UNAVAILABLE; | 266 return exit_codes.UNAVAILABLE; |
| 267 } else if (exception is FormatException) { | 267 } else if (exception is FormatException) { |
| 268 return exit_codes.DATA; | 268 return exit_codes.DATA; |
| 269 } else { | 269 } else { |
| 270 return 1; | 270 return 1; |
| 271 } | 271 } |
| 272 } | 272 } |
| 273 } | 273 } |
| OLD | NEW |