diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-07-14T11·44+0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-07-14T11·44+0200 |
commit | 112ff7833d4f3a233755b2fe856b2eb2b3723254 (patch) | |
tree | d07eb31bc6e67c48aa3bd1d0ddaf7f4a6e70f0e4 /src/libutil/args.cc | |
parent | 38374a9d35765a1c0b78bfeb02e6f22fc8643e83 (diff) |
nix: Show help when no arguments are given
Fixes #1464.
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r-- | src/libutil/args.cc | 2 |
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; |