Mercurial > hg > toybox
comparison toys/other/yes.c @ 653:2986aa63a021
Move commands into "posix", "lsb", and "other" menus/directories.
author | Rob Landley <rob@landley.net> |
---|---|
date | Sat, 25 Aug 2012 14:25:22 -0500 |
parents | toys/yes.c@163498bf547b |
children | 6df4ccc0acbe |
comparison
equal
deleted
inserted
replaced
652:2d7c56913fda | 653:2986aa63a021 |
---|---|
1 /* vi: set sw=4 ts=4: | |
2 * | |
3 * yes.c - Repeatedly output a string. | |
4 * | |
5 * Copyright 2007 Rob Landley <rob@landley.net> | |
6 * | |
7 * Not in SUSv3. | |
8 | |
9 USE_YES(NEWTOY(yes, NULL, TOYFLAG_USR|TOYFLAG_BIN)) | |
10 | |
11 config YES | |
12 bool "yes" | |
13 default y | |
14 help | |
15 usage: yes [args...] | |
16 | |
17 Repeatedly output line until killed. If no args, output 'y'. | |
18 */ | |
19 | |
20 #include "toys.h" | |
21 | |
22 void yes_main(void) | |
23 { | |
24 for (;;) { | |
25 int i; | |
26 for (i=0; toys.optargs[i]; i++) { | |
27 if (i) xputc(' '); | |
28 xprintf("%s", toys.optargs[i]); | |
29 } | |
30 if (!i) xputc('y'); | |
31 xputc('\n'); | |
32 } | |
33 } |