summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-08 19:46:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1997-09-08 19:46:39 +0000
commit1296484d08c18c5621ad2d35860296a8463b8077 (patch)
tree092fc40c7935ad68403cef35ed0f605761f918a6
parentf8864ba9364e341cde0afddb7f73c70f13fdbbf9 (diff)
put 'help' in front of 'hangman'
-rw-r--r--sys/ddb/db_command.c28
-rw-r--r--sys/ddb/db_command.h4
2 files changed, 10 insertions, 22 deletions
diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
index be23b41e9e5..4772ee2a02b 100644
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.c,v 1.12 1997/07/07 19:45:20 niklas Exp $ */
+/* $OpenBSD: db_command.c,v 1.13 1997/09/08 19:46:37 deraadt Exp $ */
/* $NetBSD: db_command.c,v 1.20 1996/03/30 22:30:05 christos Exp $ */
/*
@@ -83,7 +83,6 @@ db_skip_to_eol()
#define CMD_FOUND 1
#define CMD_NONE 2
#define CMD_AMBIGUOUS 3
-#define CMD_HELP 4
/*
* Search for command prefix.
@@ -127,12 +126,6 @@ db_cmd_search(name, table, cmdp)
}
}
}
- if (result == CMD_NONE) {
- /* check for 'help' */
- if (name[0] == 'h' && name[1] == 'e'
- && name[2] == 'l' && name[3] == 'p')
- result = CMD_HELP;
- }
return (result);
}
@@ -195,10 +188,6 @@ db_command(last_cmdp, cmd_table)
db_printf("Ambiguous\n");
db_flush_lex();
return;
- case CMD_HELP:
- db_cmd_list(cmd_table);
- db_flush_lex();
- return;
default:
break;
}
@@ -376,6 +365,7 @@ struct db_command db_command_table[] = {
{ "callout", db_show_callout, 0, NULL },
{ "show", NULL, 0, db_show_cmds },
{ "boot", NULL, 0, db_boot_cmds },
+ { "help", db_help_cmd, 0, NULL },
{ "hangman", db_hangman, 0, NULL },
{ NULL, NULL, 0, NULL }
};
@@ -396,15 +386,13 @@ struct db_command *ptr;
struct db_command *db_last_command = 0;
void
-db_help_cmd()
+db_help_cmd(addr, haddr, count, modif)
+ db_expr_t addr;
+ int haddr;
+ db_expr_t count;
+ char *modif;
{
- struct db_command *cmd = db_command_table;
-
- while (cmd->name != 0) {
- db_printf("%-12s", cmd->name);
- db_end_line(12);
- cmd++;
- }
+ db_cmd_list(db_command_table);
}
void
diff --git a/sys/ddb/db_command.h b/sys/ddb/db_command.h
index 78d2bf9fcd5..6139a06463f 100644
--- a/sys/ddb/db_command.h
+++ b/sys/ddb/db_command.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_command.h,v 1.5 1996/05/31 10:37:24 niklas Exp $ */
+/* $OpenBSD: db_command.h,v 1.6 1997/09/08 19:46:38 deraadt Exp $ */
/* $NetBSD: db_command.h,v 1.8 1996/02/05 01:56:55 christos Exp $ */
/*
@@ -41,7 +41,7 @@ void db_command __P((struct db_command **, struct db_command *));
void db_map_print_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_object_print_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_machine_commands_install __P((struct db_command *));
-void db_help_cmd __P((void));
+void db_help_cmd __P((db_expr_t, int, db_expr_t, char *));
void db_command_loop __P((void));
void db_error __P((char *));
void db_fncall __P((db_expr_t, int, db_expr_t, char *));