fix: print bare program name in usage instead of argv[0] path
This commit is contained in:
+10
-4
@@ -13,6 +13,12 @@
|
||||
#define MKDIR(path) mkdir(path, 0755)
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
#define PROGRAM_NAME "funpack.exe"
|
||||
#else
|
||||
#define PROGRAM_NAME "funpack"
|
||||
#endif
|
||||
|
||||
#define FUNPACK_LIST (1u << 0)
|
||||
#define FUNPACK_PROGRESS (1u << 1)
|
||||
#define FUNPACK_QUIET (1u << 2)
|
||||
@@ -146,9 +152,9 @@ static int extract_entry(const char *out_dir, const fpk_entry_t *entry,
|
||||
return 1;
|
||||
}
|
||||
|
||||
static void usage(const char *name)
|
||||
static void usage(void)
|
||||
{
|
||||
fprintf(stderr, "usage: %s [-d output_dir] [-l] [-p] [-q] [-v] input.fpk\n", name);
|
||||
fprintf(stderr, "usage: %s [-d output_dir] [-l] [-p] [-q] [-v] input.fpk\n", PROGRAM_NAME);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
@@ -180,12 +186,12 @@ int main(int argc, char **argv)
|
||||
flags |= FUNPACK_VERBOSE;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
usage();
|
||||
}
|
||||
}
|
||||
|
||||
if (optind != argc - 1)
|
||||
usage(argv[0]);
|
||||
usage();
|
||||
|
||||
input = argv[optind];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user