1
0
mirror of git://git.suckless.org/sbase synced 2024-12-23 23:43:33 +00:00
sbase/echo.c

33 lines
416 B
C
Raw Normal View History

2011-05-23 01:36:34 +00:00
/* See LICENSE file for copyright and license details. */
#include <stdio.h>
#include <stdlib.h>
2011-06-10 01:56:13 +00:00
#include "util.h"
2011-05-23 01:36:34 +00:00
2013-06-14 18:20:47 +00:00
static void
usage(void)
{
eprintf("usage: %s [-n] text\n", argv0);
}
2011-05-23 01:36:34 +00:00
int
main(int argc, char *argv[])
{
int nflag = 0;
2011-05-23 01:36:34 +00:00
2013-06-14 18:20:47 +00:00
ARGBEGIN {
case 'n':
nflag = 1;
2013-06-14 18:20:47 +00:00
break;
default:
usage();
} ARGEND;
for (; argc > 0; argc--, argv++)
2013-06-14 18:20:47 +00:00
putword(argv[0]);
if (!nflag)
2011-05-26 03:01:20 +00:00
putchar('\n');
2013-06-14 18:20:47 +00:00
2014-10-02 22:46:04 +00:00
return 0;
2011-05-23 01:36:34 +00:00
}