diff options
author | Simon Glass <sjg@chromium.org> | 2022-07-13 06:06:59 -0600 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2022-07-26 02:30:56 -0600 |
commit | 747244840b647991844556284aacdb3857440861 (patch) | |
tree | d6f43333ce2926a4acc8b36316eed21ba42938b4 /common/cli.c | |
parent | 281996110c1f42b5476e43040798cb38169b6119 (diff) |
fdt: Start a test for the fdt command
Add a basic test of the 'fdt addr' command, to kick things off.
This includes a new convenience function to run a command from a printf()
string.
Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/cli.c')
-rw-r--r-- | common/cli.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/common/cli.c b/common/cli.c index a7e3d84b68..a47d6a3f2b 100644 --- a/common/cli.c +++ b/common/cli.c @@ -126,6 +126,21 @@ int run_command_list(const char *cmd, int len, int flag) return rcode; } +int run_commandf(const char *fmt, ...) +{ + va_list args; + char cmd[128]; + int i, ret; + + va_start(args, fmt); + i = vsnprintf(cmd, sizeof(cmd), fmt, args); + va_end(args); + + ret = run_command(cmd, 0); + + return ret; +} + /****************************************************************************/ #if defined(CONFIG_CMD_RUN) |