void
printHelp({String parentCommandName })
Source
void printHelp({String parentCommandName}) {
print("$description");
print("$detailedDescription");
print("");
if (parentCommandName == null) {
print("Usage: $usage");
} else {
print("Usage: $parentCommandName $usage");
}
print("");
print("Options:");
print("${options.usage}");
if (options.commands.length > 0) {
print("Available sub-commands:");
var commandNames = options.commands.keys.toList();
commandNames.sort((a, b) => b.length.compareTo(a.length));
var length = commandNames.first.length + 3;
commandNames.forEach((command) {
var desc = _commandMap[command]?.description;
print(" ${command.padRight(length, " ")}$desc");
});
}
}