From 33eb0b9eef3360396aa0f650f8e1e01baf6dc181 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Sun, 1 Oct 2023 19:13:06 -0600 Subject: cli: Add a command to show cmdline history There is a function for this but it is never used. Showing the history is a useful feature, so add a new 'history' command. Signed-off-by: Simon Glass --- cmd/history.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 cmd/history.c (limited to 'cmd/history.c') diff --git a/cmd/history.c b/cmd/history.c new file mode 100644 index 00000000000..b6bf4670b1c --- /dev/null +++ b/cmd/history.c @@ -0,0 +1,23 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright 2023 Google LLC + * Written by Simon Glass + */ + +#include +#include +#include + +static int do_history(struct cmd_tbl *cmdtp, int flag, int argc, + char *const argv[]) +{ + cread_print_hist_list(); + + return 0; +} + +U_BOOT_CMD( + history, CONFIG_SYS_MAXARGS, 1, do_history, + "print command history", + "" +); -- cgit v1.2.3