diff --git a/doc/html/quit.html b/doc/html/quit.html
index 2bff2e41..e263a1a8 100644
--- a/doc/html/quit.html
+++ b/doc/html/quit.html
@@ -31,7 +31,7 @@ Exit magic
Usage:
- quit
+ quit [-noprompt]
Summary:
@@ -45,6 +45,9 @@ Exit magic
and the Tcl exit command is required to quit the program.
The Tcl exit command will always exit magic
immediately, without prompting or cleanup or any other niceties.
+
+ With the -noprompt option, the interactive confirm prompt
+ does not occur so any changes will be discarded.
Implementation Notes:
diff --git a/windows/windCmdNR.c b/windows/windCmdNR.c
index a9a33cb0..7a780472 100644
--- a/windows/windCmdNR.c
+++ b/windows/windCmdNR.c
@@ -265,15 +265,28 @@ windQuitCmd(w, cmd)
bool checkfirst = TRUE;
if (cmd->tx_argc == 2)
+ {
if (!strcmp(cmd->tx_argv[1], "-noprompt"))
+ {
checkfirst = FALSE;
+ cmd->tx_argc--;
+ }
+ }
+
+ if (cmd->tx_argc > 1)
+ {
+ TxError("Usage: quit [-noprompt]\n");
+ return;
+ }
if (checkfirst)
+ {
for (cr = windFirstClientRec; cr != (clientRec *) NULL;
cr = cr->w_nextClient)
if (cr->w_exit != NULL)
if (!(*(cr->w_exit))())
return;
+ }
MainExit(0);
}