| 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 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:io'; | 6 import 'dart:io'; |
| 7 | 7 |
| 8 import 'package:args/args.dart'; | 8 import 'package:args/args.dart'; |
| 9 import 'package:http/http.dart' as http; | 9 import 'package:http/http.dart' as http; |
| 10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 try { | 26 try { |
| 27 options = PubCommand.pubArgParser.parse(arguments); | 27 options = PubCommand.pubArgParser.parse(arguments); |
| 28 } on FormatException catch (e) { | 28 } on FormatException catch (e) { |
| 29 log.error(e.message); | 29 log.error(e.message); |
| 30 log.error('Run "pub help" to see available options.'); | 30 log.error('Run "pub help" to see available options.'); |
| 31 flushThenExit(exit_codes.USAGE); | 31 flushThenExit(exit_codes.USAGE); |
| 32 return; | 32 return; |
| 33 } | 33 } |
| 34 | 34 |
| 35 log.withPrejudice = options['with-prejudice']; |
| 36 |
| 35 if (options['version']) { | 37 if (options['version']) { |
| 36 log.message('Pub ${sdk.version}'); | 38 log.message('Pub ${sdk.version}'); |
| 37 return; | 39 return; |
| 38 } | 40 } |
| 39 | 41 |
| 40 if (options['help']) { | 42 if (options['help']) { |
| 41 PubCommand.printGlobalUsage(); | 43 PubCommand.printGlobalUsage(); |
| 42 return; | 44 return; |
| 43 } | 45 } |
| 44 | 46 |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 if (Platform.operatingSystem != 'windows') return null; | 215 if (Platform.operatingSystem != 'windows') return null; |
| 214 | 216 |
| 215 return runProcess('ver', []).then((result) { | 217 return runProcess('ver', []).then((result) { |
| 216 if (result.stdout.join('\n').contains('XP')) { | 218 if (result.stdout.join('\n').contains('XP')) { |
| 217 log.error('Sorry, but pub is not supported on Windows XP.'); | 219 log.error('Sorry, but pub is not supported on Windows XP.'); |
| 218 return flushThenExit(exit_codes.USAGE); | 220 return flushThenExit(exit_codes.USAGE); |
| 219 } | 221 } |
| 220 }); | 222 }); |
| 221 }); | 223 }); |
| 222 } | 224 } |
| OLD | NEW |