4f1d0df755
The previous code was too difficult to decipher for such a simple tool. Since yes(1) is not specified in any standard and several well-known implementations only support a single argument, do the same here. Thanks to everyone who offered implementation suggestions in the hackers@suckless.org email thread.
26 lines
313 B
C
26 lines
313 B
C
/* See LICENSE file for copyright and license details. */
|
|
#include <stdio.h>
|
|
|
|
#include "util.h"
|
|
|
|
static void
|
|
usage(void)
|
|
{
|
|
eprintf("usage: %s [string]\n", argv0);
|
|
}
|
|
|
|
int
|
|
main(int argc, char *argv[])
|
|
{
|
|
const char *s;
|
|
|
|
ARGBEGIN {
|
|
default:
|
|
usage();
|
|
} ARGEND
|
|
|
|
s = argc ? argv[0] : "y";
|
|
for (;;)
|
|
puts(s);
|
|
}
|