From b9074efcb78d914f902047cc8410532d42ce7bbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 16 Jan 2008 20:36:27 +0000 Subject: [PATCH] * Fixed the "vnodes" KDL command when called without any arguments. * Fixed the usage text of the "help" KDL command. * Made the "ambiguous command" warning shorter, so that it will still fit in the exception buffer. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@23565 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/kernel/debug/debug.cpp | 4 ++-- src/system/kernel/debug/debug_parser.cpp | 6 +++--- src/system/kernel/fs/vfs.cpp | 8 +++----- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index f210c5a999..37c1744c3b 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -589,8 +589,8 @@ cmd_shutdown(int argc, char **argv) static int cmd_help(int argc, char **argv) { - static const char* usage = "usage: %s\n" - "Lists all debugger commands.\n"; + static const char* usage = "usage: %s [name]\n" + "Lists all debugger commands or those starting with \"name\".\n"; if (argc > 1 && strcmp(argv[1], "--help") == 0) { kprintf(usage, argv[0]); return 0; diff --git a/src/system/kernel/debug/debug_parser.cpp b/src/system/kernel/debug/debug_parser.cpp index 19caf52b5e..383e209e37 100644 --- a/src/system/kernel/debug/debug_parser.cpp +++ b/src/system/kernel/debug/debug_parser.cpp @@ -626,9 +626,9 @@ ExpressionParser::_ParseCommand(int& returnCode) if (command == NULL) { if (ambiguous) { snprintf(sTempBuffer, sizeof(sTempBuffer), - "Ambiguous command \"%s\". Use tab " - "completion to get a list of matching commands. Enter \"help\" " - "to get a list of all supported commands.\n", token.string); + "Ambiguous command \"%s\". Use tab completion or enter " + "\"help %s\" get a list of matching commands.\n", token.string, + token.string); } else { snprintf(sTempBuffer, sizeof(sTempBuffer), "Unknown command \"%s\". Enter \"help\" to get a list of " diff --git a/src/system/kernel/fs/vfs.cpp b/src/system/kernel/fs/vfs.cpp index 24f54b9370..04659f1fbb 100644 --- a/src/system/kernel/fs/vfs.cpp +++ b/src/system/kernel/fs/vfs.cpp @@ -2442,15 +2442,13 @@ dump_vnode(int argc, char **argv) static int dump_vnodes(int argc, char **argv) { - if (argc > 2 || !strcmp(argv[1], "--help")) { + if (argc != 2 || !strcmp(argv[1], "--help")) { kprintf("usage: %s [device]\n", argv[0]); return 0; } // restrict dumped nodes to a certain device if requested - dev_t device = -1; - if (argc > 1) - device = parse_expression(argv[1]); + dev_t device = parse_expression(argv[1]); struct hash_iterator iterator; struct vnode *vnode; @@ -2460,7 +2458,7 @@ dump_vnodes(int argc, char **argv) hash_open(sVnodeTable, &iterator); while ((vnode = (struct vnode *)hash_next(sVnodeTable, &iterator)) != NULL) { - if (device != -1 && vnode->device != device) + if (vnode->device != device) continue; kprintf("%p%4ld%10Ld%5ld %p %p %p %s%s%s\n", vnode, vnode->device,