diff options
author | ru <ru@FreeBSD.org> | 2004-11-12 13:27:49 +0000 |
---|---|---|
committer | ru <ru@FreeBSD.org> | 2004-11-12 13:27:49 +0000 |
commit | 6261ed946f445b480a92212c51d7e26a52e3b6f8 (patch) | |
tree | 6d8e5b296b396d70ca529022c817f10cbf0ec789 /sys/boot/common/commands.c | |
parent | 3ff8bfc8dc18be9d2be1174d4229dfc06b048cad (diff) | |
download | FreeBSD-src-6261ed946f445b480a92212c51d7e26a52e3b6f8.zip FreeBSD-src-6261ed946f445b480a92212c51d7e26a52e3b6f8.tar.gz |
Pass the "?" command output through the pager.
(This doesn't quite work as this command is overridden by Forth,
and some Forth commands are appended to the output.)
Diffstat (limited to 'sys/boot/common/commands.c')
-rw-r--r-- | sys/boot/common/commands.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/boot/common/commands.c b/sys/boot/common/commands.c index 5eb599c..5ec00606 100644 --- a/sys/boot/common/commands.c +++ b/sys/boot/common/commands.c @@ -214,12 +214,23 @@ static int command_commandlist(int argc, char *argv[]) { struct bootblk_command **cmdp; - - printf("Available commands:\n"); + int res; + char name[20]; + + res = 0; + pager_open(); + res = pager_output("Available commands:\n"); SET_FOREACH(cmdp, Xcommand_set) { - if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) - printf(" %-15s %s\n", (*cmdp)->c_name, (*cmdp)->c_desc); + if (res) + break; + if (((*cmdp)->c_name != NULL) && ((*cmdp)->c_desc != NULL)) { + sprintf(name, " %-15s ", (*cmdp)->c_name); + pager_output(name); + pager_output((*cmdp)->c_desc); + res = pager_output("\n"); + } } + pager_close(); return(CMD_OK); } |