Delete the toolchain builddir after building the toolchain.
[AROS.git] / workbench / c / shellcommands / Quit.c
blob5b89fa29ffedef010cda64bfeea5269b3c1ff457
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang: English
7 */
9 /******************************************************************************
11 NAME
13 Quit
15 SYNOPSIS
17 RC/N
19 LOCATION
23 FUNCTION
25 Exits a script with the given return code. It's recommended that you
26 use the standard return codes 5, 10 and 20.
28 INPUTS
30 RC -- the return code. Defaults to 0.
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 HISTORY
46 21.01.2000 SDuvan implemented
48 ******************************************************************************/
50 #include <proto/dos.h>
51 #include <dos/dos.h>
52 #include <dos/dosextens.h>
53 #include <dos/rdargs.h>
54 #include "dos_commanderrors.h"
56 #include <aros/shcommands.h>
58 AROS_SH1(Quit, 41.1,
59 AROS_SHA(LONG *, ,RC,/N,NULL))
61 AROS_SHCOMMAND_INIT
63 struct CommandLineInterface *cli = Cli();
64 int retval = RETURN_OK;
67 if(cli && !cli->cli_Interactive)
69 struct FileHandle *fh = BADDR(cli->cli_CurrentInput);
71 fh->fh_Pos = fh->fh_End + 1; /* Simulate an EOF */
73 if(SHArg(RC) != NULL)
74 retval = (int)*SHArg(RC);
77 else
79 PrintFault(ERROR_SCRIPT_ONLY, "Quit");
80 retval = RETURN_FAIL;
83 return retval;
85 AROS_SHCOMMAND_EXIT