1
0
mirror of git://git.suckless.org/sbase synced 2024-12-28 01:52:23 +00:00
sbase/echo.c
FRIGN 22c6502b67 Add mandoc-manpage for echo(1)
and mark it as finished in the README.
2015-01-23 23:49:24 +01:00

33 lines
424 B
C

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