1
0
mirror of git://git.suckless.org/sbase synced 2024-12-26 00:42:35 +00:00
sbase/yes.c
2012-05-15 13:32:56 +01:00

37 lines
473 B
C

/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdlib.h>
#include "util.h"
static void usage(void);
int
main(int argc, char *argv[])
{
char *s = "y";
ARGBEGIN {
default:
usage();
} ARGEND;
switch(argc) {
case 1:
s = argv[0];
/* fallthrough */
case 0:
for(;;)
puts(s);
break;
default:
usage();
}
return EXIT_FAILURE; /* should not reach */
}
void
usage(void)
{
eprintf("usage: %s [string]\n", argv0);
}