Merge tag 'xilinx-for-v2025.01-rc3-v2' of https://source.denx.de/u-boot/custodians...
[u-boot.git] / cmd / pause.c
blobc97833c0d70f5d624e18d45ce8dd9f6f7a0d8f84
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3 * (C) Copyright 2021
4 * Samuel Dionne-Riel <samuel@dionne-riel.com>
5 */
7 #include <command.h>
8 #include <stdio.h>
10 static int do_pause(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
12 char *message = "Press any key to continue...";
14 if (argc == 2)
15 message = argv[1];
17 /* No newline, so it sticks to the bottom of the screen */
18 printf("%s", message);
20 /* Wait on "any" key... */
21 (void) getchar();
23 /* Since there was no newline, we need it now */
24 printf("\n");
26 return CMD_RET_SUCCESS;
29 U_BOOT_CMD(pause, 2, 1, do_pause,
30 "delay until user input",
31 "[prompt] - Wait until users presses any key. [prompt] can be used to customize the message.\n"