diff options
| author | Michael Brown | 2006-12-12 16:52:19 +0100 |
|---|---|---|
| committer | Michael Brown | 2006-12-12 16:52:19 +0100 |
| commit | 240c9512bbb49f0a307699b75bccdffcd574874b (patch) | |
| tree | a5a355943bfe72d13eb5c9ac8a3ea149e7d15767 /src | |
| parent | Added clear_setting() (diff) | |
| download | ipxe-240c9512bbb49f0a307699b75bccdffcd574874b.tar.gz ipxe-240c9512bbb49f0a307699b75bccdffcd574874b.tar.xz ipxe-240c9512bbb49f0a307699b75bccdffcd574874b.zip | |
Added "clear" command
Diffstat (limited to 'src')
| -rw-r--r-- | src/commandline/commands/nvo_cmd.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/commandline/commands/nvo_cmd.c b/src/commandline/commands/nvo_cmd.c index d859b2c04..0ea7d8624 100644 --- a/src/commandline/commands/nvo_cmd.c +++ b/src/commandline/commands/nvo_cmd.c @@ -79,3 +79,33 @@ struct command set_command __command = { .name = "set", .exec = set_exec, }; + +static int clear_exec ( int argc, char **argv ) { + struct config_context dummy_context; + int rc; + + if ( ! ugly_nvo_hack ) { + printf ( "No non-volatile option storage available\n" ); + return 1; + } + + if ( argc != 2 ) { + printf ( "Syntax: %s <identifier>\n", + argv[0] ); + return 1; + } + + dummy_context.options = ugly_nvo_hack->options; + if ( ( rc = clear_setting ( &dummy_context, argv[1] ) ) != 0 ) { + printf ( "Could not clear \"%s\": %s\n", + argv[1], strerror ( -rc ) ); + return 1; + } + + return 0; +} + +struct command clear_command __command = { + .name = "clear", + .exec = clear_exec, +}; |
