about summary refs log tree commit diff
path: root/src/libutil/args.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r--src/libutil/args.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index df7e040875d6..0eed4945418d 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -146,7 +146,7 @@ bool Args::processArgs(const Strings & args, bool finish)
         res = true;
     }
 
-    if (finish && !expectedArgs.empty())
+    if (finish && !expectedArgs.empty() && !expectedArgs.front().optional)
         throw UsageError("more arguments are required");
 
     return res;