/** "startpxe" command descriptor */
static struct command_descriptor startpxe_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>]", "" );
+ "[<interface>]" );
/**
* "startpxe" payload
/** "stoppxe" command descriptor */
static struct command_descriptor stoppxe_cmd =
- COMMAND_DESC ( struct stoppxe_options, stoppxe_opts, 0, 0,
- "", "" );
+ COMMAND_DESC ( struct stoppxe_options, stoppxe_opts, 0, 0, "" );
/**
* The "stoppxe" command
/** "reboot" command descriptor */
static struct command_descriptor reboot_cmd =
- COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "", "" );
+ COMMAND_DESC ( struct reboot_options, reboot_opts, 0, 0, "" );
/**
* The "reboot" command
/** "exit" command descriptor */
static struct command_descriptor exit_cmd =
- COMMAND_DESC ( struct exit_options, exit_opts, 0, 1,
- "[<status>]", "" );
+ COMMAND_DESC ( struct exit_options, exit_opts, 0, 1, "[<status>]" );
/**
* "exit" command
/** "isset" command descriptor */
static struct command_descriptor isset_cmd =
COMMAND_DESC ( struct isset_options, isset_opts, 0, MAX_ARGUMENTS,
- "[...]", "" );
+ "[...]" );
/**
* "isset" command
* @v argv Argument list
*/
void print_usage ( struct command_descriptor *cmd, char **argv ) {
- printf ( "Usage:\n\n %s %s\n", argv[0], cmd->usage_description );
+ printf ( "Usage:\n\n %s %s\n\nSee http://ipxe.org/cmd/%s for further "
+ "information\n", argv[0], cmd->usage, argv[0] );
}
/**
/** "autoboot" command descriptor */
static struct command_descriptor autoboot_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>...]", "Attempt to boot the system" );
+ "[<interface>...]" );
/**
* "autoboot" command
/** "config" command descriptor */
static struct command_descriptor config_cmd =
- COMMAND_DESC ( struct config_options, config_opts, 0, 1,
- "[<scope>]",
- "Open the option configuration console" );
+ COMMAND_DESC ( struct config_options, config_opts, 0, 1, "[<scope>]" );
/**
* Parse settings scope name
/** "dhcp" command descriptor */
static struct command_descriptor dhcp_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>] [<interface>...]",
- "Configure network interface(s) using DHCP" );
+ "[<interface>...]" );
/**
* Execute "dhcp" command for a network device
/** "pxebs" command descriptor */
static struct command_descriptor pxebs_cmd =
COMMAND_DESC ( struct pxebs_options, pxebs_opts, 2, 2,
- "<interface> <server_type>",
- "Perform PXE Boot Server discovery" );
+ "<interface> <server type>" );
/**
* The "pxebs" command
/** "digest" command descriptor */
static struct command_descriptor digest_cmd =
COMMAND_DESC ( struct digest_options, digest_opts, 1, MAX_ARGUMENTS,
- "<image> [<image>...]",
- "Calculate the digest of an image" );
+ "<image> [<image>...]" );
/**
* The "digest" command
/** "fcstat" command descriptor */
static struct command_descriptor fcstat_cmd =
- COMMAND_DESC ( struct fcstat_options, fcstat_opts, 0, 0,
- "", "" );
+ COMMAND_DESC ( struct fcstat_options, fcstat_opts, 0, 0, "" );
/**
* The "fcstat" command
/** "fcels" command descriptor */
static struct command_descriptor fcels_cmd =
COMMAND_DESC ( struct fcels_options, fcels_opts, 1, 1,
- "[--port <port>] [--id <peer_port_id>] <command>", "" );
+ "[--port <port>] [--id <peer port id>] <request>" );
/**
* The "fcels" command
/** "gdbstub" command descriptor */
static struct command_descriptor gdbstub_cmd =
COMMAND_DESC ( struct gdbstub_options, gdbstub_opts, 1, MAX_ARGUMENTS,
- "<transport> [<options>...]",
- "Start remote debugging using one of the following "
- "transports:\n"
- " serial use serial port (if compiled in)\n"
- " udp <interface> use UDP over network interface "
- "(if compiled in)" );
+ "<transport> [<options>...]" );
/**
* The "gdbstub" command
/** "ifopen" command descriptor */
static struct command_descriptor ifopen_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>...]",
- "Open network interface(s)" );
+ "[<interface>...]" );
/**
* "ifopen" payload
/** "ifclose" command descriptor */
static struct command_descriptor ifclose_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>...]",
- "Close network interface(s)" );
+ "[<interface>...]" );
/**
* "ifclose" payload
/** "ifstat" command descriptor */
static struct command_descriptor ifstat_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>...]",
- "Show network interface(s)" );
+ "[<interface>...]" );
/**
* "ifstat" payload
/** "imgfetch" command descriptor */
static struct command_descriptor imgfetch_cmd =
COMMAND_DESC ( struct imgfetch_options, imgfetch_opts, 1, MAX_ARGUMENTS,
- "[--name <name>] <image_url> [<arguments>...]",
- "Fetch image" );
+ "[--name <name>] <uri> [<arguments>...]" );
/** "kernel" command descriptor */
static struct command_descriptor kernel_cmd =
COMMAND_DESC ( struct imgfetch_options, imgfetch_opts, 1, MAX_ARGUMENTS,
- "[--name <name>] <image_url> [<arguments>...]",
- "Fetch and load image" );
+ "[--name <name>] <uri> [<arguments>...]" );
/** "chain" command descriptor */
static struct command_descriptor chain_cmd =
COMMAND_DESC ( struct imgfetch_options, imgfetch_opts, 1, MAX_ARGUMENTS,
- "[--name <name>] <image_url> [<arguments>...]",
- "Fetch and execute image" );
+ "[--name <name>] <uri> [<arguments>...]" );
/**
* The "imgfetch" and friends command body
/** "imgload" command descriptor */
static struct command_descriptor imgload_cmd =
- COMMAND_DESC ( struct imgload_options, imgload_opts, 1, 1,
- "<image>", "Load image" );
+ COMMAND_DESC ( struct imgload_options, imgload_opts, 1, 1, "<image>" );
/**
* The "imgload" command
/** "imgargs" command descriptor */
static struct command_descriptor imgargs_cmd =
COMMAND_DESC ( struct imgargs_options, imgargs_opts, 1, MAX_ARGUMENTS,
- "<image> [<arguments>...]",
- "Set arguments for image" );
+ "<image> [<arguments>...]" );
/**
* The "imgargs" command body
/** "imgexec" command descriptor */
static struct command_descriptor imgexec_cmd =
COMMAND_DESC ( struct imgexec_options, imgexec_opts, 0, 1,
- "[<image>]", "Execute image" );
+ "[<image>]" );
/**
* The "imgexec" command
/** "imgstat" command descriptor */
static struct command_descriptor imgstat_cmd =
- COMMAND_DESC ( struct imgstat_options, imgstat_opts, 0, 0,
- "", "List images" );
+ COMMAND_DESC ( struct imgstat_options, imgstat_opts, 0, 0, "" );
/**
* The "imgstat" command
/** "imgfree" command descriptor */
static struct command_descriptor imgfree_cmd =
COMMAND_DESC ( struct imgfree_options, imgfree_opts, 0, 1,
- "[<image>]", "Free image(s)" );
+ "[<image>]" );
/**
* The "imgfree" command
/** "iwstat" command descriptor */
static struct command_descriptor iwstat_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>...]",
- "Show wireless interface(s)" );
+ "[<interface>...]" );
/**
* "iwstat" payload
/** "iwlist" command descriptor */
static struct command_descriptor iwlist_cmd =
COMMAND_DESC ( struct ifcommon_options, ifcommon_opts, 0, MAX_ARGUMENTS,
- "[<interface>...]",
- "List wireless networks" );
+ "[<interface>...]" );
/**
* "iwlist" payload
/** "login" command descriptor */
static struct command_descriptor login_cmd =
- COMMAND_DESC ( struct login_options, login_opts, 0, 0,
- "", "Prompt for login credentials" );
+ COMMAND_DESC ( struct login_options, login_opts, 0, 0, "" );
/**
* "login" command
/** "lotest" command descriptor */
static struct command_descriptor lotest_cmd =
COMMAND_DESC ( struct lotest_options, lotest_opts, 2, 2,
- "[--mtu <mtu>] <sending_interface> "
- "<receiving_interface>", "" );
+ "[--mtu <mtu>] <sending interface> "
+ "<receiving interface>" );
/**
* "lotest" command
/** "show" command descriptor */
static struct command_descriptor show_cmd =
- COMMAND_DESC ( struct show_options, show_opts, 1, 1,
- "<setting>", "" );
+ COMMAND_DESC ( struct show_options, show_opts, 1, 1, "<setting>" );
/**
* "show" command
/** "set" command descriptor */
static struct command_descriptor set_cmd =
COMMAND_DESC ( struct set_options, set_opts, 1, MAX_ARGUMENTS,
- "<setting> <value>", "" );
+ "<setting> <value>" );
/**
* "set" command
/** "clear" command descriptor */
static struct command_descriptor clear_cmd =
- COMMAND_DESC ( struct clear_options, clear_opts, 1, 1,
- "<setting>", "" );
+ COMMAND_DESC ( struct clear_options, clear_opts, 1, 1, "<setting>" );
/**
* "clear" command
/** "route" command descriptor */
static struct command_descriptor route_cmd =
- COMMAND_DESC ( struct route_options, route_opts, 0, 0,
- "", "Display the routing table" );
+ COMMAND_DESC ( struct route_options, route_opts, 0, 0, "" );
/**
* The "route" command
/** "sanboot" command descriptor */
static struct command_descriptor sanboot_cmd =
COMMAND_DESC ( struct sanboot_options, sanboot_opts, 1, 1,
- "<root-path>", "Boot from SAN target" );
+ "<root-path>" );
/**
* The "sanboot" command
/** "time" command descriptor */
static struct command_descriptor time_cmd =
COMMAND_DESC ( struct time_options, time_opts, 1, MAX_ARGUMENTS,
- "<command>", "Time a command" );
+ "<command>" );
/**
* "time" command
/** "sleep" command descriptor */
static struct command_descriptor sleep_cmd =
- COMMAND_DESC ( struct sleep_options, sleep_opts, 1, 1,
- "<seconds>", "Sleep for <seconds> seconds" );
+ COMMAND_DESC ( struct sleep_options, sleep_opts, 1, 1, "<seconds>" );
/**
* "sleep" command
static struct command_descriptor vcreate_cmd =
COMMAND_DESC ( struct vcreate_options, vcreate_opts, 1, 1,
"--tag <tag> [--priority <priority>] "
- "<trunk interface>",
- "Create a VLAN interface" );
+ "<trunk interface>" );
/**
* "vcreate" command
/** "vdestroy" command descriptor */
static struct command_descriptor vdestroy_cmd =
COMMAND_DESC ( struct vdestroy_options, vdestroy_opts, 1, 1,
- "<VLAN interface>",
- "Destroy a VLAN interface" );
+ "<VLAN interface>" );
/**
* "vdestroy" command
/** "shell" command descriptor */
static struct command_descriptor shell_cmd =
- COMMAND_DESC ( struct shell_options, shell_opts, 0, 0,
- "", "" );
+ COMMAND_DESC ( struct shell_options, shell_opts, 0, 0, "" );
/**
* "shell" command
/** "goto" command descriptor */
static struct command_descriptor goto_cmd =
- COMMAND_DESC ( struct goto_options, goto_opts, 1, 1,
- "<label>", "" );
+ COMMAND_DESC ( struct goto_options, goto_opts, 1, 1, "<label>" );
/**
* Current "goto" label
uint8_t min_args;
/** Maximum number of non-option arguments */
uint8_t max_args;
- /** Command usage and description
+ /** Command usage
*
* This excludes the literal "Usage:" and the command name,
* which will be prepended automatically.
*/
- const char *usage_description;
+ const char *usage;
};
/** No maximum number of arguments */
* @v _options Option descriptor array
* @v _check_args Remaining argument checker
* @v _usage Command usage
- * @v _description Command description
* @ret _command Command descriptor
*/
-#define COMMAND_DESC( _struct, _options, _min_args, _max_args, _usage, \
- _description ) \
+#define COMMAND_DESC( _struct, _options, _min_args, _max_args, _usage ) \
{ \
.options = ( ( ( ( typeof ( _options[0] ) * ) NULL ) == \
( ( struct option_descriptor * ) NULL ) ) ? \
.len = sizeof ( _struct ), \
.min_args = _min_args, \
.max_args = _max_args, \
- .usage_description = _usage "\n\n" _description, \
+ .usage = _usage, \
}
extern int parse_string ( const char *text, const char **value );