nix: Show help when no arguments are given

Fixes #1464.
This commit is contained in:
Eelco Dolstra
2017-07-14 13:44:45 +02:00
parent 38374a9d35
commit 112ff7833d
4 changed files with 14 additions and 10 deletions
+1 -1
View File
@@ -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;