sbase/yes.c
Michael Forney 4f1d0df755 yes: Simplify, only support one argument
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.
2019-10-31 18:14:18 -07:00

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);
}