OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 args.help_command; | |
6 | |
7 import '../command_runner.dart'; | 5 import '../command_runner.dart'; |
8 | 6 |
9 /// The built-in help command that's added to every [CommandRunner]. | 7 /// The built-in help command that's added to every [CommandRunner]. |
10 /// | 8 /// |
11 /// This command displays help information for the various subcommands. | 9 /// This command displays help information for the various subcommands. |
12 class HelpCommand extends Command { | 10 class HelpCommand extends Command { |
13 final name = "help"; | 11 final name = "help"; |
14 String get description => | 12 String get description => |
15 "Display help information for ${runner.executableName}."; | 13 "Display help information for ${runner.executableName}."; |
16 String get invocation => "${runner.executableName} help [command]"; | 14 String get invocation => "${runner.executableName} help [command]"; |
(...skipping 27 matching lines...) Expand all Loading... |
44 } | 42 } |
45 | 43 |
46 command = commands[name]; | 44 command = commands[name]; |
47 commands = command.subcommands; | 45 commands = command.subcommands; |
48 commandString += " $name"; | 46 commandString += " $name"; |
49 } | 47 } |
50 | 48 |
51 command.printUsage(); | 49 command.printUsage(); |
52 } | 50 } |
53 } | 51 } |
OLD | NEW |