1
0
mirror of https://github.com/simh/simh.git synced 2026-01-31 05:43:06 +00:00

Added -Q option to RETURN with a specific status, and an always implied -Q when returning the last command status since presumably the related message has already been displayed.

This commit is contained in:
Mark Pizzolato
2012-03-29 08:16:55 -07:00
parent b0a3bf6f4e
commit 3a89ffe9bb

8
scp.c
View File

@@ -698,7 +698,7 @@ static CTAB cmd_table[] = {
"goto <label> goto label in command file\n" }, "goto <label> goto label in command file\n" },
{ "RETURN", &return_cmd, 0, { "RETURN", &return_cmd, 0,
"return return from command file with last command status\n" "return return from command file with last command status\n"
"return <status> return from command file with specific status\n" }, "return {-Q} <status> return from command file with specific status\n" },
{ "ON", &on_cmd, 0, { "ON", &on_cmd, 0,
"on <condition> <action> perform action after condition\n" "on <condition> <action> perform action after condition\n"
"on <condition> clear action for specific condition\n" }, "on <condition> clear action for specific condition\n" },
@@ -1166,10 +1166,12 @@ sim_on_check[sim_do_depth] = 0; /* clear on mode */
sim_brk_clract (); /* defang breakpoint actions */ sim_brk_clract (); /* defang breakpoint actions */
--sim_do_depth; /* unwind nesting */ --sim_do_depth; /* unwind nesting */
if (cmdp && (cmdp->action == &return_cmd)) { /* return command? */ if (cmdp && (cmdp->action == &return_cmd)) { /* return command? */
if (0 == *cptr) if (0 == *cptr) /* No Argument? */
return stat; /* return with last command status */ return stat | SCPE_NOMESSAGE; /* return last command status (suppressing message)*/
sim_string_to_stat (cptr, &stat); sim_string_to_stat (cptr, &stat);
sim_last_cmd_stat = stat; /* save explicit status as command error status */ sim_last_cmd_stat = stat; /* save explicit status as command error status */
if (sim_switches & SWMASK ('Q'))
stat |= SCPE_NOMESSAGE; /* suppress error message display (in caller) if requested */
return stat; /* return with explicit return status */ return stat; /* return with explicit return status */
} }
return (stat == SCPE_EXIT) ? SCPE_EXIT : SCPE_OK; return (stat == SCPE_EXIT) ? SCPE_EXIT : SCPE_OK;