2 Copyright © 1995-2015, The AROS Development Team. All rights reserved.
9 /******************************************************************************
25 Exits a script with the given return code. It's recommended that you
26 use the standard return codes 5, 10 and 20.
30 RC -- the return code. Defaults to 0.
35 If this command is called in a script that is executed from another
36 script, the entire series of nested scripts will stop.
46 ******************************************************************************/
48 #include <proto/dos.h>
50 #include <dos/dosextens.h>
51 #include <dos/rdargs.h>
52 #include "dos_commanderrors.h"
54 #include <aros/shcommands.h>
57 AROS_SHA(LONG
*, ,RC
,/N
,NULL
))
61 struct CommandLineInterface
*cli
= Cli();
62 int retval
= RETURN_OK
;
65 if(cli
&& !cli
->cli_Interactive
)
67 struct FileHandle
*fh
= BADDR(cli
->cli_CurrentInput
);
69 fh
->fh_Pos
= fh
->fh_End
+ 1; /* Simulate an EOF */
72 retval
= (int)*SHArg(RC
);
77 PrintFault(ERROR_SCRIPT_ONLY
, "Quit");