summaryrefslogtreecommitdiffstats
path: root/src/hci/shell.c
diff options
context:
space:
mode:
authorMichael Brown2007-08-03 02:03:21 +0200
committerMichael Brown2007-08-03 02:03:21 +0200
commit6e46dddc2c7521a076a4d274e4a89a69e9c1981d (patch)
tree3a6dc3fc8cc1b20df87801f7497fc04b5e8de1bd /src/hci/shell.c
parentPlace multiboot command lines in base memory; Xen won't pick them up (diff)
downloadipxe-6e46dddc2c7521a076a4d274e4a89a69e9c1981d.tar.gz
ipxe-6e46dddc2c7521a076a4d274e4a89a69e9c1981d.tar.xz
ipxe-6e46dddc2c7521a076a4d274e4a89a69e9c1981d.zip
Print multiple commands per line in help
Diffstat (limited to 'src/hci/shell.c')
-rw-r--r--src/hci/shell.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/hci/shell.c b/src/hci/shell.c
index b14af542..18b1068e 100644
--- a/src/hci/shell.c
+++ b/src/hci/shell.c
@@ -62,12 +62,22 @@ struct command exit_command __command = {
/** "help" command body */
static int help_exec ( int argc __unused, char **argv __unused ) {
struct command *command;
+ unsigned int hpos = 0;
printf ( "\nAvailable commands:\n\n" );
for ( command = commands ; command < commands_end ; command++ ) {
- printf ( " %s\n", command->name );
+ hpos += printf ( " %s", command->name );
+ if ( hpos > ( 16 * 4 ) ) {
+ printf ( "\n" );
+ hpos = 0;
+ } else {
+ while ( hpos % 16 ) {
+ printf ( " " );
+ hpos++;
+ }
+ }
}
- printf ( "\nType \"<command> --help\" for further information\n\n" );
+ printf ( "\n\nType \"<command> --help\" for further information\n\n" );
return 0;
}