Fix args error msg
This commit is contained in:
parent
89b97deeff
commit
aeafcc6891
3
Makefile
3
Makefile
@ -11,9 +11,8 @@ LIB:=
|
||||
|
||||
DEPS:=$($(IDIR)/%.h)
|
||||
|
||||
#SRCS:=$(wildcard $(SRCDIR)/*.c)
|
||||
SRCS=$(shell find . -name "*.c")
|
||||
BASENAME:=$(shell basename $(SRCS))
|
||||
BASENAME:=$(shell basename -a $(SRCS))
|
||||
|
||||
VPATH=$(dir $(SRCS))
|
||||
|
||||
|
10
src/main.c
10
src/main.c
@ -64,7 +64,7 @@ int run(char *filename) {
|
||||
lc++;
|
||||
int padlen = lcpad - intlen(lc);
|
||||
char padding[padlen];
|
||||
memset(padding, '0', padlen);
|
||||
memset(padding, ' ', padlen);
|
||||
if (tty)
|
||||
fprintf(stderr, "%s%s%d:%s ", GREY, padding, lc, RESET);
|
||||
}
|
||||
@ -83,16 +83,16 @@ int run(char *filename) {
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "usage: catclone <FILE>\n");
|
||||
die("args");
|
||||
fprintf(stderr, "usage: %s <FILE/s>\n", argv[0]);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for (int i = 1; i < argc; i++) {
|
||||
for (int i = 1; i < argc; i++) { // start at one to offset argv[0]
|
||||
if (run(argv[i]) != 0)
|
||||
die("run");
|
||||
|
||||
if (i + 1 != argc) {
|
||||
fprintf(stderr, "\r\n");
|
||||
fprintf(stderr, "\r\n"); // separate concurrent files
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user