annotate toys/yes.c @ 562:4d802d438983

Match uint64_t with PRIu64 to avoid warnings on 64 bit builds.
author Rob Landley <rob@landley.net>
date Sat, 14 Apr 2012 21:27:00 -0500
parents 163498bf547b
children
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
234
163498bf547b Move NEWTOY() list from end of toylist.h to generated/newtoys.h.
Rob Landley <rob@landley.net>
parents: 233
diff changeset
9 USE_YES(NEWTOY(yes, NULL, TOYFLAG_USR|TOYFLAG_BIN))
163498bf547b Move NEWTOY() list from end of toylist.h to generated/newtoys.h.
Rob Landley <rob@landley.net>
parents: 233
diff changeset
10
233
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
11 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
12 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
13 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
14 help
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
15 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
16
d4176f3f3835 Zap toys/Config.in and instead create generated/Config.in from contents of
Rob Landley <rob@landley.net>
parents: 194
diff changeset
17 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
18 */
74
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
19
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
20 #include "toys.h"
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
21
186
25447caf1b4b Change command main() functions to return void, and exit(toys.exitval) from
Rob Landley <rob@landley.net>
parents: 151
diff changeset
22 void yes_main(void)
74
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
23 {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
24 for (;;) {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
25 int i;
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
26 for (i=0; toys.optargs[i]; i++) {
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
27 if (i) xputc(' ');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
28 xprintf("%s", toys.optargs[i]);
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
29 }
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
30 if (!i) xputc('y');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
31 xputc('\n');
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
32 }
dfe99495acbc Add "yes" command.
Rob Landley <rob@landley.net>
parents:
diff changeset
33 }