shcommands: Cleanup SH_GLOBAL_SYSBASE, SH_GLOBAL_DOSBASE usage
[AROS.git] / workbench / tools / debug / kecho / KEcho.c
blobd542cf34965ee49b643a16dfa7b17b22f450e9f1
1 /*
2 Copyright © 1995-2010, The AROS Development Team. All rights reserved.
3 $Id$
5 Desc:
6 Lang:
7 */
9 /******************************************************************************
11 NAME
13 KEcho [<string>] [NOLINE]
15 SYNOPSIS
17 STRINGS/M,NOLINE/S
19 LOCATION
21 SYS:tests
23 FUNCTION
25 Appends one or more strings to the debug output.
27 INPUTS
29 STRINGS -- the strings to display
30 NOLINE -- no newline after the last string
32 RESULT
34 NOTES
36 EXAMPLE
38 BUGS
40 SEE ALSO
42 INTERNALS
44 ******************************************************************************/
46 #define DEBUG 0
47 #include <aros/debug.h>
49 #include <exec/execbase.h>
50 #include <exec/libraries.h>
51 #include <proto/exec.h>
52 #include <dos/dos.h>
53 #include <proto/dos.h>
54 #include <string.h>
56 #define SH_GLOBAL_SYSBASE 1 /* for kprintf() */
57 #include <aros/shcommands.h>
59 AROS_SH2(KEcho, 41.1,
60 AROS_SHA(STRPTR *, , STRINGS, /M, NULL),
61 AROS_SHA(BOOL, , NOLINE, /S, FALSE))
63 AROS_SHCOMMAND_INIT
65 LONG error = 0;
66 STRPTR *a;
68 a = SHArg(STRINGS);
70 if (a) while (*a != NULL)
72 kprintf("%s", *a);
73 a++;
74 if (*a)
75 kprintf(" ");
78 if (!SHArg(NOLINE))
79 kprintf("\n");
81 return error;
83 AROS_SHCOMMAND_EXIT