Mercurial > hg > toybox
annotate toys/yes.c @ 74:dfe99495acbc
Add "yes" command.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 20 Jan 2007 23:41:49 -0500 |
parents | |
children | bb6048c923ec |
rev | line source |
---|---|
74 | 1 /* vi: set sw=4 ts=4: */ |
2 /* | |
3 * hello.c - A hello world program. | |
4 */ | |
5 | |
6 #include "toys.h" | |
7 | |
8 int yes_main(void) | |
9 { | |
10 for (;;) { | |
11 int i; | |
12 for (i=0; toys.optargs[i]; i++) { | |
13 if (i) xputc(' '); | |
14 xprintf("%s", toys.optargs[i]); | |
15 } | |
16 if (!i) xputc('y'); | |
17 xputc('\n'); | |
18 } | |
19 | |
20 return 0; | |
21 } |