http://git.etherboot.org
/
people
/
sha0
/
gpxe.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
688bac1
)
Print multiple commands per line in help
author
Michael Brown
<mcb30@etherboot.org>
Fri, 3 Aug 2007 00:03:21 +0000
(
01:03
+0100)
committer
Michael Brown
<mcb30@etherboot.org>
Fri, 3 Aug 2007 00:03:21 +0000
(
01:03
+0100)
src/hci/shell.c
patch
|
blob
|
history
diff --git
a/src/hci/shell.c
b/src/hci/shell.c
index
b14af54
..
18b1068
100644
(file)
--- 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;
/** "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 ( "\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
\n
Type \"<command> --help\" for further information\n\n" );
return 0;
}
return 0;
}