aboutsummaryrefslogtreecommitdiff
path: root/src/nix/run.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2019-06-18 16:01:35 +0200
committerEelco Dolstra <edolstra@gmail.com>2019-06-18 16:25:31 +0200
commita0de58f471c9087d8e6cc60a6078f9940a125b15 (patch)
tree45211b7ecd10f372c9a4a8e4b6cba7a30560ce21 /src/nix/run.cc
parenteb18aedccbc0d01b6a5cc720ce1befd0b316aebf (diff)
Make subcommand construction in MultiCommand lazy
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r--src/nix/run.cc14
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)
{