2 * Copyright (C) 2010 Michael Brown <mbrown@fensystems.co.uk>.
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation; either version 2 of the
7 * License, or any later version.
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24 #include <ipxe/command.h>
25 #include <ipxe/parseopt.h>
26 #include <ipxe/settings.h>
27 #include <ipxe/settings_ui.h>
29 FILE_LICENCE ( GPL2_OR_LATER );
33 * Configuration UI commands
37 /** "config" options */
38 struct config_options {};
40 /** "config" option list */
41 static struct option_descriptor config_opts[] = {};
43 /** "config" command descriptor */
44 static struct command_descriptor config_cmd =
45 COMMAND_DESC ( struct config_options, config_opts, 0, 1, "[<scope>]" );
50 * @v argc Argument count
51 * @v argv Argument list
52 * @ret rc Return status code
54 static int config_exec ( int argc, char **argv ) {
55 struct config_options opts;
56 struct settings *settings;
60 if ( ( rc = parse_options ( argc, argv, &config_cmd, &opts ) ) != 0 )
63 /* Parse settings option, if present */
64 if ( ( rc = parse_settings ( ( ( optind < argc ) ? argv[optind] : "" ),
69 if ( ( rc = settings_ui ( settings ) ) != 0 ) {
70 printf ( "Could not save settings: %s\n", strerror ( rc ) );
77 /** Configuration UI commands */
78 struct command config_command __command = {