#include <string.h>#include <stdio.h>#include <gpxe/command.h>#include <gpxe/settings.h>#include <gpxe/settings_ui.h>Go to the source code of this file.
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| static int | config_exec (int argc, char **argv) |
Variables | |
| struct command config_command | __command |
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| static int config_exec | ( | int | argc, | |
| char ** | argv | |||
| ) | [static] |
Definition at line 9 of file config_cmd.c.
References find_settings(), printf(), settings_name(), settings_ui(), and strerror().
00009 { 00010 char *settings_name; 00011 struct settings *settings; 00012 int rc; 00013 00014 if ( argc > 2 ) { 00015 printf ( "Usage: %s [scope]\n" 00016 "Opens the option configuration console\n", argv[0] ); 00017 return 1; 00018 } 00019 00020 settings_name = ( ( argc == 2 ) ? argv[1] : "" ); 00021 settings = find_settings ( settings_name ); 00022 if ( ! settings ) { 00023 printf ( "No such scope \"%s\"\n", settings_name ); 00024 return 1; 00025 } 00026 00027 if ( ( rc = settings_ui ( settings ) ) != 0 ) { 00028 printf ( "Could not save settings: %s\n", 00029 strerror ( rc ) ); 00030 return 1; 00031 } 00032 00033 return 0; 00034 }
Initial value:
{
.name = "config",
.exec = config_exec,
}
Definition at line 36 of file config_cmd.c.
1.5.7.1