summaryrefslogtreecommitdiff
path: root/pkgrel.c
diff options
context:
space:
mode:
Diffstat (limited to 'pkgrel.c')
-rw-r--r--pkgrel.c5
1 files changed, 3 insertions, 2 deletions
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) {