From c8dcfebd2293279eb8aefeffa11b8a35a233cf2e Mon Sep 17 00:00:00 2001 From: Aki Date: Sat, 6 Jan 2024 18:33:48 +0100 Subject: Added -- -d --- pkgrel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'pkgrel.c') diff --git a/pkgrel.c b/pkgrel.c index 961ecbd..fe25fe4 100644 --- a/pkgrel.c +++ b/pkgrel.c @@ -118,13 +118,14 @@ parse_args(const int argc, char* argv[]) { int opt; const char* prefix = NULL; - while (-1 != (opt = getopt(argc, argv, ":d"))) { + while (NULL == prefix && -1 != (opt = getopt(argc, argv, ":d"))) { switch (opt) { case 'd': prefix = "pkgrel="; break; default: - break; // Accept anything but -d without prior -- + prefix = argv[optind - 1]; // Use first option that is not -d as a normal prefix, too. + break; } } if (NULL == prefix) { -- cgit v1.1