| /* SPDX-License-Identifier: GPL-2.0+ */ |
| * The 'exception' command can be used for testing exception handling. |
| * Copyright (c) 2018, Heinrich Schuchardt <xypron.glpk@gmx.de> |
| static int do_exception(cmd_tbl_t *cmdtp, int flag, int argc, |
| /* drop sub-command parameter */ |
| cp = find_cmd_tbl(argv[0], cmd_sub, ARRAY_SIZE(cmd_sub)); |
| return cp->cmd(cmdtp, flag, argc, argv); |
| static int exception_complete(int argc, char * const argv[], char last_char, |
| for (cmdtp = cmd_sub; cmdtp != cmd_sub + ARRAY_SIZE(cmd_sub); cmdtp++) { |
| if (!strncmp(argv[1], cmdtp->name, len)) |
| exception, 2, 0, do_exception, |
| "Forces an exception to occur", |
| exception_help_text, exception_complete |