The usage string directly printed by print_debugger_command() and

invoke_debugger_command() is now automatically preceded by
"usage: <command name>", so the string passed to
add_debugger_command_etc() shouldn't contain it anymore. 


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23584 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ingo Weinhold
2008-01-17 13:58:17 +00:00
parent dccabf3cc9
commit e6a8dfa805
2 changed files with 11 additions and 9 deletions
+4 -2
View File
@@ -99,7 +99,8 @@ invoke_debugger_command(struct debugger_command *command, int argc, char** argv)
// If we know the command's usage text, intercept "--help" invocations
// and print it directly.
if (argc == 2 && strcmp(argv[1], "--help") == 0 && command->usage != NULL) {
kprintf(command->usage, command->name);
kprintf("usage: %s ", command->name);
kprintf(command->usage);
return 0;
}
@@ -233,7 +234,8 @@ print_debugger_command_usage(const char* commandName)
// directly print the usage text, if we know it, otherwise invoke the
// command with "--help"
if (command->usage != NULL) {
kprintf(command->usage, command->name);
kprintf("usage: %s ", command->name);
kprintf(command->usage);
} else {
char* args[3] = { NULL, "--help", NULL };
invoke_debugger_command(command, 2, args);