81 goto err_parse_options;
94 goto err_create_dynui;
144 "[<name> [<text>]]" );
157 unsigned int flags = 0;
164 goto err_parse_options;
181 goto err_parse_dynui;
184 if (
opts.is_default )
186 if (
opts.is_secret )
192 goto err_add_dynui_item;
250 goto err_parse_options;
255 goto err_parse_setting;
259 goto err_parse_dynui;
272 item->
name ) ) != 0 ) {
273 printf (
"Could not store \"%s\": %s\n",
326 goto err_parse_options;
330 goto err_parse_dynui;
char * dynui
Dynamic user interface name.
static struct command_descriptor dynui_cmd
"dynui" command descriptor
struct arbelprm_rc_send_wqe rc
A dynamic user interface item.
int printf(const char *fmt,...)
Write a formatted string to the console.
int parse_key(char *text, unsigned int *key)
Parse key.
int optind
Current option index.
static int item_exec(int argc, char **argv)
The "item" command.
int parse_dynui(char *text, struct dynamic_ui **dynui)
Parse dynamic user interface name.
static int present_exec(int argc, char **argv)
The "present" command.
#define DHCP_EB_FEATURE_MENU
Menu support.
int parse_timeout(char *text, unsigned long *value)
Parse timeout value (in ms)
int parse_autovivified_setting(char *text, struct named_setting *setting)
Parse and autovivify setting name.
int keep
Keep dynamic user interface.
struct command dynui_commands [] __command
Dynamic user interface commands.
int parse_options(int argc, char **argv, struct command_descriptor *cmd, void *opts)
Parse command-line options.
FEATURE(FEATURE_MISC, "Menu", DHCP_EB_FEATURE_MENU, 1)
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
static struct option_descriptor present_opts[]
"present" option list
static struct command_descriptor present_cmd
"present" command descriptor
static struct command_descriptor item_cmd
"item" command descriptor
#define ENOMEM
Not enough space.
char * select
Default selection.
int keep
Keep dynamic user interface.
Parse command-line options.
static int dynui_exec(int argc, char **argv)
The "dynui" command.
int parse_string(char *text, char **value)
Parse string value.
#define MAX_ARGUMENTS
No maximum number of arguments.
char * concat_args(char **args)
Concatenate arguments.
const struct setting_type * type
Setting type.
int is_default
Use as default.
static int choose_exec(int argc, char **argv)
The "choose" command.
static struct option_descriptor item_opts[]
"item" option list
struct dynamic_ui * create_dynui(const char *name, const char *title)
Create dynamic user interface.
static struct option_descriptor choose_opts[]
"choose" option list
#define FEATURE_MISC
Miscellaneous.
int storef_setting(struct settings *settings, const struct setting *setting, const char *value)
Store formatted value of setting.
int parse_flag(char *text __unused, int *flag)
Parse flag.
struct dynamic_item * add_dynui_item(struct dynamic_ui *dynui, const char *name, const char *text, unsigned int flags, int shortcut)
Add dynamic user interface item.
char * strerror(int errno)
Retrieve string representation of error number.
static void(* free)(struct refcnt *refcnt))
static struct command_descriptor choose_cmd
"choose" command descriptor
Command line option parsing.
int select(fd_set *readfds, int wait)
Check file descriptors for readiness.
Option does not take an argument.
const char * name
Name of the command.
A dynamic user interface.
char * dynui
Dynamic user interface name.
int is_secret
Value is a secret.
int is_gap
Use as a separator.
static struct option_descriptor dynui_opts[]
"dynui" option list
#define DYNUI_DEFAULT
Dynamic user interface item is default selection.
#define OPTION_DESC(_longopt, _shortopt, _has_arg, _struct, _field, _parse)
Construct option descriptor.
Option requires an argument.
A command-line option descriptor.
#define COMMAND_DESC(_struct, _options, _min_args, _max_args, _usage)
Construct command descriptor.
char * dynui
Dynamic user interface name.
unsigned long timeout
Timeout.
static union @438 opts
"cert<xxx>" option list
void destroy_dynui(struct dynamic_ui *dynui)
Destroy dynamic user interface.
#define NULL
NULL pointer (VOID *)
#define DYNUI_SECRET
Dynamic user interface item represents a secret.
unsigned int key
Shortcut key.