nix run: Fix "flag '--command' requires 2 argument(s)"

This commit is contained in:
Eelco Dolstra 2017-11-20 18:07:58 +01:00
parent 4eb9e20028
commit 1ff01187e2
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -30,8 +30,8 @@ struct CmdRun : InstallablesCommand
.longName("command") .longName("command")
.shortName('c') .shortName('c')
.description("command and arguments to be executed; defaults to 'bash'") .description("command and arguments to be executed; defaults to 'bash'")
.arity(ArityAny)
.labels({"command", "args"}) .labels({"command", "args"})
.arity(ArityAny)
.handler([&](std::vector<std::string> ss) { .handler([&](std::vector<std::string> ss) {
if (ss.empty()) throw UsageError("--command requires at least one argument"); if (ss.empty()) throw UsageError("--command requires at least one argument");
command = ss; command = ss;