coreboot/payloads/ubootcli/cmd_help.c
Ronald G. Minnich bf8f85bfe6 payload/ubootcli: add the u-boot cli
This is a first cut at the u-boot cli. It builds and loads and runs
and has no commands. That's next.

Interestingly, this is code right from our u-boot tree, and it's full
of style violations which I don't intend to fix.

Remove dependency on anything else, but this won't work until the
libpayload serial drivers for arm are set up.

BUG=None
TEST=build and boot on nyan and get a u-boot cli prompt.
BRANCH=None

Change-Id: I52cf7c02e2bdd00a82e6e48fd2471416c87e4627
Signed-off-by: Ronald G. Minnich <rminnich@google.com>
Reviewed-on: https://chromium-review.googlesource.com/179721
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Commit-Queue: Puneet Kumar <puneetster@chromium.org>
Tested-by: Puneet Kumar <puneetster@chromium.org>
2014-01-09 13:58:47 +00:00

47 lines
1.5 KiB
C

/*
* Copyright 2000-2009
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
* See file CREDITS for list of people who contributed to this
* project.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*/
#include "ubootcli.h"
static int do_help(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
{
cmd_tbl_t *start = ll_entry_start(cmd_tbl_t, cmd);
const int len = ll_entry_count(cmd_tbl_t, cmd);
return _do_help(start, len, cmdtp, flag, argc, argv);
}
U_BOOT_CMD(
help, CONFIG_SYS_MAXARGS, 1, do_help,
"print command description/usage",
"\n"
" - print brief description of all commands\n"
"help command ...\n"
" - print detailed usage of 'command'"
);
/* This does not use the U_BOOT_CMD macro as ? can't be used in symbol names */
ll_entry_declare(cmd_tbl_t, question_mark, cmd) = {
"?", CONFIG_SYS_MAXARGS, 1, do_help,
"alias for 'help'",
""
};