| 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 import 'dart:math' as math; | 7 import 'dart:math' as math; |
| 8 | 8 |
| 9 import 'package:args/args.dart'; | 9 import 'package:args/args.dart'; |
| 10 import 'package:path/path.dart' as path; | 10 import 'package:path/path.dart' as path; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 } | 41 } |
| 42 | 42 |
| 43 if (options.command == null) { | 43 if (options.command == null) { |
| 44 if (options.rest.isEmpty) { | 44 if (options.rest.isEmpty) { |
| 45 // No command was chosen. | 45 // No command was chosen. |
| 46 printUsage(); | 46 printUsage(); |
| 47 } else { | 47 } else { |
| 48 log.error('Could not find a command named "${options.rest[0]}".'); | 48 log.error('Could not find a command named "${options.rest[0]}".'); |
| 49 log.error('Run "pub help" to see available commands.'); | 49 log.error('Run "pub help" to see available commands.'); |
| 50 flushThenExit(exit_codes.USAGE); | 50 flushThenExit(exit_codes.USAGE); |
| 51 return; | |
| 52 } | 51 } |
| 53 return; | 52 return; |
| 54 } | 53 } |
| 55 | 54 |
| 56 if (options['trace']) { | 55 if (options['trace']) { |
| 57 log.recordTranscript(); | 56 log.recordTranscript(); |
| 58 } | 57 } |
| 59 | 58 |
| 60 switch (options['verbosity']) { | 59 switch (options['verbosity']) { |
| 61 case 'normal': log.showNormal(); break; | 60 case 'normal': log.showNormal(); break; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 for (var name in names) { | 165 for (var name in names) { |
| 167 buffer.write(' ${padRight(name, length)} ' | 166 buffer.write(' ${padRight(name, length)} ' |
| 168 '${PubCommand.commands[name].description}\n'); | 167 '${PubCommand.commands[name].description}\n'); |
| 169 } | 168 } |
| 170 | 169 |
| 171 buffer.write('\n'); | 170 buffer.write('\n'); |
| 172 buffer.write( | 171 buffer.write( |
| 173 'Use "pub help [command]" for more information about a command.'); | 172 'Use "pub help [command]" for more information about a command.'); |
| 174 log.message(buffer.toString()); | 173 log.message(buffer.toString()); |
| 175 } | 174 } |
| OLD | NEW |