diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2020-05-04 22:40:19 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2020-05-04 22:40:19 +0200 |
commit | a721a0b1140bf489d645f5d85737acafc1c57c65 (patch) | |
tree | f4b7df80fccc95b46fd3e8419375b563b466cfa4 /src/nix/run.cc | |
parent | e9f10beed1a30fe80b315a9de4c4c2ab11527db8 (diff) |
Flag: Use designated initializers
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r-- | src/nix/run.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc index ebfec36d9..b888281a5 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -63,16 +63,16 @@ struct CmdShell : InstallablesCommand, RunCommon, MixEnvironment CmdShell() { - mkFlag() - .longName("command") - .shortName('c') - .description("command and arguments to be executed; defaults to '$SHELL'") - .labels({"command", "args"}) - .arity(ArityAny) - .handler([&](std::vector<std::string> ss) { + addFlag({ + .longName = "command", + .shortName = 'c', + .description = "command and arguments to be executed; defaults to '$SHELL'", + .labels = {"command", "args"}, + .handler = {[&](std::vector<std::string> ss) { if (ss.empty()) throw UsageError("--command requires at least one argument"); command = ss; - }); + }} + }); } std::string description() override |