mirror of
https://github.com/ipxe/ipxe
synced 2025-12-14 07:50:43 +03:00
[cmdline] Show commands in alphabetical order
Commands were originally ordered by functional group (e.g. keeping the image management commands together), with arrays used to impose a functionally meaningful order within the group. As the number of commands and functional groups has expanded over the years, this has become essentially useless as an organising principle. Switch to sorting commands alphabetically (using the linker table mechanism). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -21,7 +21,12 @@ struct command {
|
||||
|
||||
#define COMMANDS __table ( struct command, "commands" )
|
||||
|
||||
#define __command __table_entry ( COMMANDS, 01 )
|
||||
#define __command( name ) __table_entry ( COMMANDS, _C2 ( 01., name ) )
|
||||
|
||||
#define COMMAND( name, exec ) \
|
||||
struct command name ## _command __command ( name ) = { \
|
||||
#name, exec \
|
||||
}
|
||||
|
||||
extern char * concat_args ( char **args );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user