revert between 56095 -> 55830 in arch
[AROS.git] / workbench / c / shellcommands / Prompt.c
blob25d49f28b53993e0ce344bb5379e77f336537a61
1 /*
2 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc: Prompt CLI command
6 Lang: English
7 */
9 /*****************************************************************************
11 NAME
13 Prompt
15 SYNOPSIS
17 PROMPT
19 LOCATION
23 FUNCTION
25 Specify the prompt for the current shell.
27 INPUTS
29 PROMPT -- The prompt to set as a string. The following commands
30 may be used in a printf kind of style.
32 N -- cli number
33 S -- name of the current directory
34 R -- return code of the last operation
36 If no prompt is specified "%N.%S> " is used as default.
38 RESULT
40 Standard DOS return codes.
42 NOTES
44 EXAMPLE
46 Prompt "Oepir Risti.%N> " gives:
48 Oepir Risti.10> (if the CLI number was 10)
50 BUGS
52 SEE ALSO
54 dos.library/SetPrompt()
56 INTERNALS
58 HISTORY
60 16-12-99 SDuvan Implemented
62 ******************************************************************************/
64 #include <dos/dos.h>
65 #include <dos/dosextens.h>
66 #include <proto/dos.h>
68 #include <aros/shcommands.h>
70 AROS_SH1(Prompt,41.1,
71 AROS_SHA(STRPTR, ,PROMPT, , "%N.%S> "))
73 AROS_SHCOMMAND_INIT
76 if (SetPrompt(SHArg(PROMPT)) == DOSFALSE)
78 PrintFault(IoErr(), "Prompt");
80 return RETURN_ERROR;
83 return RETURN_OK;
85 AROS_SHCOMMAND_EXIT