summaryrefslogtreecommitdiffstats
path: root/src/core/exec.c
diff options
context:
space:
mode:
authorMichael Brown2025-08-06 17:29:32 +0200
committerMichael Brown2025-08-06 17:34:45 +0200
commit9d4a2ee3538f28a21a77c55c272c84b4e346dd92 (patch)
tree07e34d6baf1c66bb85b0d5acf24ba57e483bc53b /src/core/exec.c
parent[digest] Treat inability to acquire an image as a fatal error (diff)
downloadipxe-9d4a2ee3538f28a21a77c55c272c84b4e346dd92.tar.gz
ipxe-9d4a2ee3538f28a21a77c55c272c84b4e346dd92.tar.xz
ipxe-9d4a2ee3538f28a21a77c55c272c84b4e346dd92.zip
[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>
Diffstat (limited to 'src/core/exec.c')
-rw-r--r--src/core/exec.c25
1 files changed, 5 insertions, 20 deletions
diff --git a/src/core/exec.c b/src/core/exec.c
index a13884b68..534fb9993 100644
--- a/src/core/exec.c
+++ b/src/core/exec.c
@@ -428,10 +428,7 @@ static int echo_exec ( int argc, char **argv ) {
}
/** "echo" command */
-struct command echo_command __command = {
- .name = "echo",
- .exec = echo_exec,
-};
+COMMAND ( echo, echo_exec );
/** "exit" options */
struct exit_options {};
@@ -472,10 +469,7 @@ static int exit_exec ( int argc, char **argv ) {
}
/** "exit" command */
-struct command exit_command __command = {
- .name = "exit",
- .exec = exit_exec,
-};
+COMMAND ( exit, exit_exec );
/** "isset" options */
struct isset_options {};
@@ -507,10 +501,7 @@ static int isset_exec ( int argc, char **argv ) {
}
/** "isset" command */
-struct command isset_command __command = {
- .name = "isset",
- .exec = isset_exec,
-};
+COMMAND ( isset, isset_exec );
/** "iseq" options */
struct iseq_options {};
@@ -544,10 +535,7 @@ static int iseq_exec ( int argc, char **argv ) {
}
/** "iseq" command */
-struct command iseq_command __command = {
- .name = "iseq",
- .exec = iseq_exec,
-};
+COMMAND ( iseq, iseq_exec );
/** "sleep" options */
struct sleep_options {};
@@ -587,7 +575,4 @@ static int sleep_exec ( int argc, char **argv ) {
}
/** "sleep" command */
-struct command sleep_command __command = {
- .name = "sleep",
- .exec = sleep_exec,
-};
+COMMAND ( sleep, sleep_exec );