mirror of
https://github.com/ipxe/ipxe
synced 2025-12-26 09:32:33 +03:00
[parseopt] Move parse_settings() to parseopt.c
Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -44,28 +44,6 @@ static struct option_descriptor config_opts[] = {};
|
||||
static struct command_descriptor config_cmd =
|
||||
COMMAND_DESC ( struct config_options, config_opts, 0, 1, "[<scope>]" );
|
||||
|
||||
/**
|
||||
* Parse settings scope name
|
||||
*
|
||||
* @v text Text
|
||||
* @ret value Integer value
|
||||
* @ret rc Return status code
|
||||
*/
|
||||
static int parse_settings ( const char *text, struct settings **value ) {
|
||||
|
||||
/* Sanity check */
|
||||
assert ( text != NULL );
|
||||
|
||||
/* Parse scope name */
|
||||
*value = find_settings ( text );
|
||||
if ( ! *value ) {
|
||||
printf ( "\"%s\": no such scope\n", text );
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* "config" command
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user