[syslinux:master] hdt: Fixing help display

syslinux-bot for Erwan Velu erwan.velu at free.fr
Sun Feb 6 14:07:19 PST 2011


Commit-ID:  d68fcda165f4626bd4cb9427c7f267d7a6f7bb14
Gitweb:     http://syslinux.zytor.com/commit/d68fcda165f4626bd4cb9427c7f267d7a6f7bb14
Author:     Erwan Velu <erwan.velu at free.fr>
AuthorDate: Mon, 7 Dec 2009 21:34:06 +0100
Committer:  Erwan Velu <erwan.velu at free.fr>
CommitDate: Mon, 7 Dec 2009 21:34:06 +0100

hdt: Fixing help display

Impact: Visual

Closes ticket #30
We have to show the default commands after the commands title , not after the
"show" items


---
 com32/hdt/hdt-cli-hdt.c |   43 ++++++++++++++++++++++---------------------
 1 files changed, 22 insertions(+), 21 deletions(-)

diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c
index fc0d7f3..f52bcae 100644
--- a/com32/hdt/hdt-cli-hdt.c
+++ b/com32/hdt/hdt-cli-hdt.c
@@ -129,6 +129,28 @@ static void show_cli_help(int argc __unused, char **argv __unused,
 	printf("\n");
     }
 
+    /* List finally the default modules of the hdt mode */
+    if (current_mode->mode != hdt_mode.mode &&
+	hdt_mode.default_modules && hdt_mode.default_modules->modules) {
+	j = 0;
+	while (hdt_mode.default_modules->modules[j].name) {
+	    /*
+	     * Any default command that is present in hdt mode but
+	     * not in the current mode is available. A default
+	     * command can be redefined in the current mode though.
+	     * This next call test this use case: if it is
+	     * overwritten, do not print it again.
+	     */
+	    find_cli_callback_descr(hdt_mode.default_modules->modules[j].name,
+				    current_mode->default_modules,
+				    &associated_module);
+	    if (associated_module == NULL)
+		printf("%s ", hdt_mode.default_modules->modules[j].name);
+	    j++;
+	}
+	printf("\n");
+    }
+
     /* List secondly the show modules of the mode */
     if (current_mode->show_modules && current_mode->show_modules->modules) {
 	printf("\nshow commands:\n");
@@ -151,27 +173,6 @@ static void show_cli_help(int argc __unused, char **argv __unused,
 	printf("\n");
     }
 
-    /* List finally the default modules of the hdt mode */
-    if (current_mode->mode != hdt_mode.mode &&
-	hdt_mode.default_modules && hdt_mode.default_modules->modules) {
-	j = 0;
-	while (hdt_mode.default_modules->modules[j].name) {
-	    /*
-	     * Any default command that is present in hdt mode but
-	     * not in the current mode is available. A default
-	     * command can be redefined in the current mode though.
-	     * This next call test this use case: if it is
-	     * overwritten, do not print it again.
-	     */
-	    find_cli_callback_descr(hdt_mode.default_modules->modules[j].name,
-				    current_mode->default_modules,
-				    &associated_module);
-	    if (associated_module == NULL)
-		printf("%s ", hdt_mode.default_modules->modules[j].name);
-	    j++;
-	}
-	printf("\n");
-    }
 
     printf("\n");
     main_show_modes(argc, argv, hardware);



More information about the Syslinux-commits mailing list