From 838a76a0426844e918d12ae0d2e2ee7622a0eca6 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Sat, 28 Apr 2012 23:18:55 +0100 Subject: [PATCH] [menu] Add "--default" option to "choose" command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested-by: Robin Smidsrød Signed-off-by: Michael Brown --- src/hci/commands/menu_cmd.c | 10 +++++++--- src/hci/tui/menu_ui.c | 11 ++++++++--- src/include/ipxe/menu.h | 2 +- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/hci/commands/menu_cmd.c b/src/hci/commands/menu_cmd.c index 8dac3cb8..ff3b76fa 100644 --- a/src/hci/commands/menu_cmd.c +++ b/src/hci/commands/menu_cmd.c @@ -194,6 +194,8 @@ struct choose_options { const char *menu; /** Timeout */ unsigned int timeout; + /** Default selection */ + const char *select; /** Keep menu */ int keep; }; @@ -202,6 +204,8 @@ struct choose_options { static struct option_descriptor choose_opts[] = { OPTION_DESC ( "menu", 'm', required_argument, struct choose_options, menu, parse_string ), + OPTION_DESC ( "default", 'd', required_argument, + struct choose_options, select, parse_string ), OPTION_DESC ( "timeout", 't', required_argument, struct choose_options, timeout, parse_integer ), OPTION_DESC ( "keep", 'k', no_argument, @@ -211,8 +215,8 @@ static struct option_descriptor choose_opts[] = { /** "choose" command descriptor */ static struct command_descriptor choose_cmd = COMMAND_DESC ( struct choose_options, choose_opts, 1, 1, - "[--menu ] [--timeout ] [--keep] " - "" ); + "[--menu ] [--default