mirror of
https://github.com/ipxe/ipxe
synced 2025-12-22 04:50:25 +03:00
[parseopt] Refer to online documentation for command help
The online documentation (e.g. http://ipxe.org/cmd/ifopen), though not yet complete, is far more comprehensive than could be provided within the iPXE binary. Save around 200 bytes (compressed) by removing the command descriptions from the interactive help, and instead referring users directly to the web page describing the relevant command. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -81,12 +81,12 @@ struct command_descriptor {
|
||||
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 */
|
||||
@@ -99,11 +99,9 @@ struct command_descriptor {
|
||||
* @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 ) ) ? \
|
||||
@@ -113,7 +111,7 @@ struct command_descriptor {
|
||||
.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 );
|
||||
|
||||
Reference in New Issue
Block a user