help formatting, remove segv involving no filename after nth option
This commit is contained in:
parent
481638424b
commit
9656fa557f
12
bake.c
12
bake.c
@ -37,8 +37,8 @@
|
|||||||
#define DESC \
|
#define DESC \
|
||||||
"Options [Must always be put first, may be merged together]\n" \
|
"Options [Must always be put first, may be merged together]\n" \
|
||||||
"\t" DIM "-v --version" RESET ", " DIM "-h --help" RESET ", " \
|
"\t" DIM "-v --version" RESET ", " DIM "-h --help" RESET ", " \
|
||||||
BOLD "-n --dry-run" RESET ", " BOLD "-x --expunge\n" RESET ", " \
|
BOLD "-n --dry-run" RESET ", " BOLD "-x --expunge" RESET ", " \
|
||||||
BOLD "-c --color" RESET \
|
BOLD "-c --color\n" RESET \
|
||||||
"Expansions\n" \
|
"Expansions\n" \
|
||||||
"\t" YELLOW "@FILENAME" RESET " returns target-file (abc.x.txt)\n" \
|
"\t" YELLOW "@FILENAME" RESET " returns target-file (abc.x.txt)\n" \
|
||||||
"\t" YELLOW "@SHORT " RESET " returns target-file without suffix (^-> abc.x)\n" \
|
"\t" YELLOW "@SHORT " RESET " returns target-file without suffix (^-> abc.x)\n" \
|
||||||
@ -570,6 +570,14 @@ main(int argc, char ** argv) {
|
|||||||
next:;
|
next:;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!argc)
|
||||||
|
{
|
||||||
|
color_fprintf(stderr, BOLD RED "%s" RESET
|
||||||
|
": No filename provided\n",
|
||||||
|
argv0);
|
||||||
|
return BAKE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
filename = argv[0];
|
filename = argv[0];
|
||||||
++argv, --argc;
|
++argv, --argc;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user