abuild-tar: improve invalid opt handling
make sure we always print usage help text if we have an invalid option. fixes https://gitlab.alpinelinux.org/alpine/abuild/-/issues/10101
This commit is contained in:
parent
2d446f094c
commit
6ef57910ab
|
@ -385,7 +385,10 @@ int main(int argc, char **argv)
|
||||||
ENGINE_register_all_complete();
|
ENGINE_register_all_complete();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
while (getopt_long(argc, argv, "", options, &ndx) != -1) {
|
int c;
|
||||||
|
while ((c = getopt_long(argc, argv, "", options, &ndx)) != -1) {
|
||||||
|
if (c == '?')
|
||||||
|
return usage(stderr);
|
||||||
if (ndx == 0)
|
if (ndx == 0)
|
||||||
digest = optarg ? optarg : "sha1";
|
digest = optarg ? optarg : "sha1";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue