iPXE
Data Structures | Functions | Variables
config_cmd.c File Reference

Configuration UI commands. More...

#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <getopt.h>
#include <ipxe/command.h>
#include <ipxe/parseopt.h>
#include <ipxe/settings.h>
#include <ipxe/settings_ui.h>

Go to the source code of this file.

Data Structures

struct  config_options
 "config" options More...

Functions

 FILE_LICENCE (GPL2_OR_LATER_OR_UBDL)
static int config_exec (int argc, char **argv)
 "config" command

Variables

static struct option_descriptor config_opts [] = {}
 "config" option list
static struct command_descriptor config_cmd
 "config" command descriptor
struct command config_command __command
 Configuration UI commands.

Detailed Description

Configuration UI commands.

Definition in file config_cmd.c.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL  )
static int config_exec ( int  argc,
char **  argv 
) [static]

"config" command

Parameters:
argcArgument count
argvArgument list
Return values:
rcReturn status code

Definition at line 58 of file config_cmd.c.

References optind, parse_options(), parse_settings(), printf(), rc, and strerror().

                                                 {
        struct config_options opts;
        struct settings *settings;
        int rc;

        /* Parse options */
        if ( ( rc = parse_options ( argc, argv, &config_cmd, &opts ) ) != 0 )
                return rc;

        /* Parse settings option, if present */
        if ( ( rc = parse_settings ( ( ( optind < argc ) ? argv[optind] : "" ),
                                     &settings ) ) != 0 )
                return rc;

        /* Run settings UI */
        if ( ( rc = settings_ui ( settings ) ) != 0 ) {
                printf ( "Could not save settings: %s\n", strerror ( rc ) );
                return rc;
        }

        return 0;
}

Variable Documentation

struct option_descriptor config_opts[] = {} [static]

"config" option list

Definition at line 45 of file config_cmd.c.

struct command_descriptor config_cmd [static]
Initial value:
        COMMAND_DESC ( struct config_options, config_opts, 0, 1, "[<scope>]" )

"config" command descriptor

Definition at line 48 of file config_cmd.c.

struct command config_command __command
Initial value:
 {
        .name = "config",
        .exec = config_exec,
}

Configuration UI commands.

Definition at line 82 of file config_cmd.c.