sbase/echo.c
stateless 7216a53a7e Remove unnecessary exit(1) in usage()
Signed-off-by: Christoph Lohmann <20h@r-36.net>
2013-06-19 19:58:19 +02:00

35 lines
463 B
C

/* See LICENSE file for copyright and license details. */
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "util.h"
static void
usage(void)
{
eprintf("usage: %s [-n] text\n", argv0);
}
int
main(int argc, char *argv[])
{
bool nflag = false;
ARGBEGIN {
case 'n':
nflag = true;
break;
default:
usage();
} ARGEND;
for(; argc > 0; argc--, argv++)
putword(argv[0]);
if(!nflag)
putchar('\n');
return 0;
}