1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

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
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
4 changed files with 14 additions and 10 deletions

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;