Added EndShell command and changed capitalisation of EndCLI command to match
[tangerine.git] / workbench / c / shellcommands / EndShell.c
blob9adc53ac3407a3b3416e30e3dfcdcf6691815ec9
1 /*
2 Copyright © 1995-2008, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: EndShell CLI command
6 Lang: English
7 */
9 /******************************************************************************
12 NAME
14 EndShell
16 SYNOPSIS
18 LOCATION
22 FUNCTION
24 Exits a Shell/CLI.
26 INPUTS
28 RESULT
30 NOTES
32 EXAMPLE
34 BUGS
36 SEE ALSO
38 INTERNALS
40 HISTORY
42 ******************************************************************************/
45 #include <proto/dos.h>
46 #include <dos/dos.h>
47 #include <dos/dosextens.h>
49 #include <aros/shcommands.h>
51 AROS_SH0(EndShell, 41.3)
53 AROS_SHCOMMAND_INIT
55 struct CommandLineInterface *cli = Cli();
58 if (cli)
60 struct FileHandle *fhin = BADDR(cli->cli_CurrentInput);
61 struct FileHandle *fhout = BADDR(cli->cli_StandardOutput);
63 cli->cli_Background = TRUE;
65 fhin->fh_Pos = fhin->fh_End + 1; /* Simulate an EOF */
66 fhout->fh_Pos = fhout->fh_Buf; /* don't flush cli's standard output on close*/
69 return RETURN_OK;
71 AROS_SHCOMMAND_EXIT