diff --git a/echo.c b/echo.c index 8280137..c845c47 100644 --- a/echo.c +++ b/echo.c @@ -1,26 +1,17 @@ /* See LICENSE file for copyright and license details. */ #include - +#include #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': + if (*++argv && !strcmp(*argv, "-n")) { nflag = 1; - break; - default: - usage(); - } ARGEND; + argc--, argv++; + } for (; *argv; argc--, argv++) putword(*argv);