annotate toys/yes.c @ 233:d4176f3f3835

Zap toys/Config.in and instead create generated/Config.in from contents of toys/*.c. Move relevant info into comment at the top of each toys/*.c. Also convert more of Makefile into a thin wrapper around shell scripts that actually do the work. (Makefile is only still there for the user interface.)
author Rob Landley <rob@landley.net>
date Sat, 19 Jan 2008 17:08:39 -0600
parents 30a6db5a95c2
children 163498bf547b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
233
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
1 /* vi: set sw=4 ts=4:
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
2 *
151
bb6048c923ec Add or correct file descriptions
Charlie Shepherd <masterdriverz@gentoo.org>
parents: 74
diff changeset
3 * yes.c - Repeatedly output a string.
194
30a6db5a95c2 Add comments about SUSv3 specs (or lack thereof).
Rob Landley <rob@landley.net>
parents: 186
diff changeset
4 *
233
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
5 * Copyright 2007 Rob Landley <rob@landley.net>
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
6 *
194
30a6db5a95c2 Add comments about SUSv3 specs (or lack thereof).
Rob Landley <rob@landley.net>
parents: 186
diff changeset
7 * Not in SUSv3.
233
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
8
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
9 config YES
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
10 bool "yes"
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
11 default y
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
12 help
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
13 usage: yes [args...]
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
14
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
15 Repeatedly output line until killed. If no args, output 'y'.
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
16 */
74
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
17
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
18 #include "toys.h"
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
19
186
25447caf1b4b Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents: 151
diff changeset
20 void yes_main(void)
74
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
21 {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
22 for (;;) {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 int i;
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 for (i=0; toys.optargs[i]; i++) {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 if (i) xputc(' ');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 xprintf("%s", toys.optargs[i]);
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 }
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 if (!i) xputc('y');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 xputc('\n');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 }
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 }