Add ARGNUM and ARGNUMF(base)

This is useful to support the obsolete syntax -NUM for tools like
head, tail and fold.
This commit is contained in:
dsp
2013-11-11 19:53:01 +00:00
committed by sin
parent 2046778bc9
commit 3f9e501f6b
4 changed files with 23 additions and 3 deletions

4
head.c
View File

@@ -23,6 +23,9 @@ main(int argc, char *argv[])
case 'n':
n = estrtol(EARGF(usage()), 0);
break;
ARGNUM:
n = ARGNUMF(0);
break;
default:
usage();
} ARGEND;
@@ -53,4 +56,3 @@ head(FILE *fp, const char *str, long n)
if(ferror(fp))
eprintf("%s: read error:", str);
}