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)
|
DEPS:=$($(IDIR)/%.h)
|
||||||
|
|
||||||
#SRCS:=$(wildcard $(SRCDIR)/*.c)
|
|
||||||
SRCS=$(shell find . -name "*.c")
|
SRCS=$(shell find . -name "*.c")
|
||||||
BASENAME:=$(shell basename $(SRCS))
|
BASENAME:=$(shell basename -a $(SRCS))
|
||||||
|
|
||||||
VPATH=$(dir $(SRCS))
|
VPATH=$(dir $(SRCS))
|
||||||
|
|
||||||
|
10
src/main.c
10
src/main.c
@ -64,7 +64,7 @@ int run(char *filename) {
|
|||||||
lc++;
|
lc++;
|
||||||
int padlen = lcpad - intlen(lc);
|
int padlen = lcpad - intlen(lc);
|
||||||
char padding[padlen];
|
char padding[padlen];
|
||||||
memset(padding, '0', padlen);
|
memset(padding, ' ', padlen);
|
||||||
if (tty)
|
if (tty)
|
||||||
fprintf(stderr, "%s%s%d:%s ", GREY, padding, lc, RESET);
|
fprintf(stderr, "%s%s%d:%s ", GREY, padding, lc, RESET);
|
||||||
}
|
}
|
||||||
@ -83,16 +83,16 @@ int run(char *filename) {
|
|||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
if (argc < 2) {
|
if (argc < 2) {
|
||||||
fprintf(stderr, "usage: catclone <FILE>\n");
|
fprintf(stderr, "usage: %s <FILE/s>\n", argv[0]);
|
||||||
die("args");
|
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)
|
if (run(argv[i]) != 0)
|
||||||
die("run");
|
die("run");
|
||||||
|
|
||||||
if (i + 1 != argc) {
|
if (i + 1 != argc) {
|
||||||
fprintf(stderr, "\r\n");
|
fprintf(stderr, "\r\n"); // separate concurrent files
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user