summaryrefslogtreecommitdiff
path: root/cmd/pause.c
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2022-09-02 21:51:21 -0400
committerTom Rini <[email protected]>2022-09-02 21:53:36 -0400
commit98b3a998b31a83d8167f888b11ddd5cce8194f35 (patch)
tree91e5c815982e9f1823f86f61bc49e28d948d1b4c /cmd/pause.c
parent2d7069126d11f8708ee38c68b1c6cafae5e50dae (diff)
parent21ddac140e3040b2693c1a5558a84c19a879c04f (diff)
Merge branch '2022-09-02-assorted-improvements' into next
- DM RTC improvements that should help in CI, allow disabling LTO from the make line, add extension (cape, etc) support to distro bootcmd, add a pause command and re-enable ARM v4T support.
Diffstat (limited to 'cmd/pause.c')
-rw-r--r--cmd/pause.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/cmd/pause.c b/cmd/pause.c
new file mode 100644
index 00000000000..c97833c0d70
--- /dev/null
+++ b/cmd/pause.c
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * (C) Copyright 2021
+ * Samuel Dionne-Riel <[email protected]>
+ */
+
+#include <command.h>
+#include <stdio.h>
+
+static int do_pause(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
+{
+ char *message = "Press any key to continue...";
+
+ if (argc == 2)
+ message = argv[1];
+
+ /* No newline, so it sticks to the bottom of the screen */
+ printf("%s", message);
+
+ /* Wait on "any" key... */
+ (void) getchar();
+
+ /* Since there was no newline, we need it now */
+ printf("\n");
+
+ return CMD_RET_SUCCESS;
+}
+
+U_BOOT_CMD(pause, 2, 1, do_pause,
+ "delay until user input",
+ "[prompt] - Wait until users presses any key. [prompt] can be used to customize the message.\n"
+);