Mercurial > hg > toybox
comparison toys/echo.c @ 294:3de1ea4d6b56
Fix command line option parsing so "echo -xen" actually prints "-xen". Add
echo.test while I'm at it.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 17 May 2008 17:13:26 -0500 |
parents | 163498bf547b |
children | 93223118c813 |
comparison
equal
deleted
inserted
replaced
293:6baa13382880 | 294:3de1ea4d6b56 |
---|---|
4 * | 4 * |
5 * Copyright 2007 Rob Landley <rob@landley.net> | 5 * Copyright 2007 Rob Landley <rob@landley.net> |
6 * | 6 * |
7 * See http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html | 7 * See http://www.opengroup.org/onlinepubs/009695399/utilities/echo.html |
8 | 8 |
9 USE_ECHO(NEWTOY(echo, "+en", TOYFLAG_BIN)) | 9 USE_ECHO(NEWTOY(echo, "+?en", TOYFLAG_BIN)) |
10 | 10 |
11 config ECHO | 11 config ECHO |
12 bool "echo" | 12 bool "echo" |
13 default y | 13 default y |
14 help | 14 help |
16 | 16 |
17 Write each argument to stdout, with one space between each, followed | 17 Write each argument to stdout, with one space between each, followed |
18 by a newline. | 18 by a newline. |
19 | 19 |
20 -n No trailing newline. | 20 -n No trailing newline. |
21 -e Process the following escape sequences: | 21 -e Process the following escape sequences: |
22 \\ backslash | 22 \\ backslash |
23 \a alert (beep/flash) | 23 \a alert (beep/flash) |
24 \b backspace | 24 \b backspace |
25 \c Stop output here (avoids trailing newline) | 25 \c Stop output here (avoids trailing newline) |
26 \f form feed | 26 \f form feed |
27 \n newline | 27 \n newline |
28 \r carriage return | 28 \r carriage return |
29 \t horizontal tab | 29 \t horizontal tab |
30 \v vertical tab | 30 \v vertical tab |
31 */ | 31 */ |
32 | 32 |
33 #include "toys.h" | 33 #include "toys.h" |
34 | 34 |
35 void echo_main(void) | 35 void echo_main(void) |