mirror of
https://github.com/ipxe/ipxe
synced 2026-02-14 02:31:26 +03:00
[parseopt] Add parse_timeout()
Parsing a timeout value (specified in milliseconds) into an internal timeout value measured in timer ticks is a common operation. Provide a parse_timeout() value to carry out this conversion automatically. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -361,7 +361,7 @@ struct prompt_options {
|
||||
/** Key to wait for */
|
||||
unsigned int key;
|
||||
/** Timeout */
|
||||
unsigned int timeout;
|
||||
unsigned long timeout;
|
||||
};
|
||||
|
||||
/** "prompt" option list */
|
||||
@@ -369,7 +369,7 @@ static struct option_descriptor prompt_opts[] = {
|
||||
OPTION_DESC ( "key", 'k', required_argument,
|
||||
struct prompt_options, key, parse_key ),
|
||||
OPTION_DESC ( "timeout", 't', required_argument,
|
||||
struct prompt_options, timeout, parse_integer ),
|
||||
struct prompt_options, timeout, parse_timeout ),
|
||||
};
|
||||
|
||||
/** "prompt" command descriptor */
|
||||
|
||||
Reference in New Issue
Block a user