From 584a12c6981a020af5a6d9a4155ce8feffb94235 Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Wed, 25 Nov 2009 23:10:34 +0100 Subject: hdt: Adding history command Impact: new command 'history' This command allow to see the content of the history --- com32/hdt/hdt-cli-hdt.c | 4 ++++ com32/hdt/hdt-cli.c | 1 - com32/hdt/hdt-cli.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c index 99a54b41..86d95fe7 100644 --- a/com32/hdt/hdt-cli-hdt.c +++ b/com32/hdt/hdt-cli-hdt.c @@ -274,6 +274,10 @@ struct cli_callback_descr list_hdt_default_modules[] = { .name = CLI_REBOOT, .exec = do_reboot, }, + { + .name = CLI_HISTORY, + .exec = print_history, + }, { .name = NULL, .exec = NULL}, diff --git a/com32/hdt/hdt-cli.c b/com32/hdt/hdt-cli.c index 1a6997a1..7a710a10 100644 --- a/com32/hdt/hdt-cli.c +++ b/com32/hdt/hdt-cli.c @@ -782,7 +782,6 @@ void start_auto_mode(struct s_hardware *hardware) void print_history() { - printf("History\n"); for (int i = 1; i < MAX_HISTORY_SIZE - 1; i++) { if (i == hdt_cli.history_pos) { printf("*%d:'%s'\n", i, hdt_cli.history[i]); diff --git a/com32/hdt/hdt-cli.h b/com32/hdt/hdt-cli.h index 12e71274..7d8a0261 100644 --- a/com32/hdt/hdt-cli.h +++ b/com32/hdt/hdt-cli.h @@ -157,6 +157,9 @@ void start_cli_mode(struct s_hardware *hardware); void start_auto_mode(struct s_hardware *hardware); void main_show(char *item, struct s_hardware *hardware); +#define CLI_HISTORY "history" +void print_history(); + // DMI STUFF #define CLI_DMI_BASE_BOARD "base_board" #define CLI_DMI_BATTERY "battery" -- cgit v1.2.1