common: cli: allow fall back to simple cli
The simple CLI mode only support run_command() which can't support powerful command line syntax like if...then...else...fi conditionals or `&&' and '||'. The run_command_list() falls back to run_command(). Signed-off-by: Joseph Chen <chenjh@rock-chips.com> Change-Id: I136cba71e02fd1f57c9a395b37679d9a885ba4a0
This commit is contained in:
parent
f3ff8d72ff
commit
aedbab3f0f
|
|
@ -59,7 +59,7 @@ obj-$(CONFIG_MENU) += menu.o
|
|||
obj-$(CONFIG_UPDATE_TFTP) += update.o
|
||||
obj-$(CONFIG_DFU_TFTP) += update.o
|
||||
obj-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
|
||||
obj-$(CONFIG_CMDLINE) += cli_readline.o cli_simple.o
|
||||
obj-y += cli_readline.o cli_simple.o
|
||||
|
||||
endif # !CONFIG_SPL_BUILD
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,11 @@
|
|||
|
||||
DECLARE_GLOBAL_DATA_PTR;
|
||||
|
||||
#ifdef CONFIG_CMDLINE
|
||||
__weak int board_run_command(const char *cmdline)
|
||||
{
|
||||
return cli_simple_run_command_list((char *)cmdline, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* Run a command using the selected parser.
|
||||
*
|
||||
|
|
@ -69,7 +73,6 @@ int run_command_repeatable(const char *cmd, int flag)
|
|||
return 0;
|
||||
#endif
|
||||
}
|
||||
#endif /* CONFIG_CMDLINE */
|
||||
|
||||
int run_command_list(const char *cmd, int len, int flag)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -85,7 +85,6 @@ int _do_help(cmd_tbl_t *cmd_start, int cmd_items, cmd_tbl_t *cmdtp, int flag,
|
|||
/* find command table entry for a command */
|
||||
cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len)
|
||||
{
|
||||
#ifdef CONFIG_CMDLINE
|
||||
cmd_tbl_t *cmdtp;
|
||||
cmd_tbl_t *cmdtp_temp = table; /* Init value */
|
||||
const char *p;
|
||||
|
|
@ -112,7 +111,6 @@ cmd_tbl_t *find_cmd_tbl(const char *cmd, cmd_tbl_t *table, int table_len)
|
|||
if (n_found == 1) { /* exactly one match */
|
||||
return cmdtp_temp;
|
||||
}
|
||||
#endif /* CONFIG_CMDLINE */
|
||||
|
||||
return NULL; /* not found or ambiguous command */
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue