changes to make cmd compile (not link)
[reactos.git] / reactos / apps / utils / cmd / echo.c
1 /*
2 * ECHO.C - echo internal command.
3 *
4 *
5 * History:
6 *
7 * 16 Jul 1998 (Hans B Pufal)
8 * Started.
9 *
10 * 16 Jul 1998 (John P Price)
11 * Separated commands into individual files.
12 *
13 * 27-Jul-1998 (John P Price <linux-guru@gcfl.net>)
14 * Added config.h include
15 *
16 * 08-Dec-1998 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
17 * Added help text ("/?").
18 *
19 * 19-Jan-1999 (Eric Kohl <ekohl@abo.rhein-zeitung.de>)
20 * Unicode and redirection ready!
21 */
22
23 #include "config.h"
24
25 #include <windows.h>
26 #include <tchar.h>
27 #include <string.h>
28
29 #include "cmd.h"
30 #include "batch.h"
31
32
33 INT cmd_echo (LPTSTR cmd, LPTSTR param)
34 {
35 #ifdef _DEBUG
36 DebugPrintf ("cmd_echo '%s' : '%s'\n", cmd, param);
37 #endif
38
39 if (!_tcsncmp (param, _T("/?"), 2))
40 {
41 ConOutPuts ("Displays messages or switches command echoing on or off.\n\n"
42 "ECHO [ON | OFF]\nECHO [message]\n\n"
43 "Type ECHO without a parameter to display the current ECHO setting.");
44 return 0;
45 }
46
47 if (_tcsicmp (param, D_OFF) == 0)
48 bEcho = FALSE;
49 else if (_tcsicmp (param, D_ON) == 0)
50 bEcho = TRUE;
51 else if (*param)
52 ConOutPuts (param);
53 else
54 ConOutPrintf (_T("ECHO is %s\n"), bEcho ? D_ON : D_OFF);
55
56 return 0;
57 }