diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2019-06-18 16:01:35 +0200 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2019-06-18 16:25:31 +0200 |
commit | a0de58f471c9087d8e6cc60a6078f9940a125b15 (patch) | |
tree | 45211b7ecd10f372c9a4a8e4b6cba7a30560ce21 /src/nix/run.cc | |
parent | eb18aedccbc0d01b6a5cc720ce1befd0b316aebf (diff) |
Make subcommand construction in MultiCommand lazy
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r-- | src/nix/run.cc | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc index d30851d47..9c15b6749 100644 --- a/src/nix/run.cc +++ b/src/nix/run.cc @@ -99,11 +99,6 @@ struct CmdRun : InstallablesCommand, RunCommon .handler([&](std::vector<std::string> ss) { unset.insert(ss.front()); }); } - std::string name() override - { - return "run"; - } - std::string description() override { return "run a shell in which the specified packages are available"; @@ -192,7 +187,7 @@ struct CmdRun : InstallablesCommand, RunCommon } }; -static RegisterCommand r1(make_ref<CmdRun>()); +static auto r1 = registerCommand<CmdRun>("run"); struct CmdApp : InstallableCommand, RunCommon { @@ -203,11 +198,6 @@ struct CmdApp : InstallableCommand, RunCommon expectArgs("args", &args); } - std::string name() override - { - return "app"; - } - std::string description() override { return "run a Nix application"; @@ -248,7 +238,7 @@ struct CmdApp : InstallableCommand, RunCommon } }; -static RegisterCommand r2(make_ref<CmdApp>()); +static auto r2 = registerCommand<CmdApp>("app"); void chrootHelper(int argc, char * * argv) { |