aboutsummaryrefslogtreecommitdiff
path: root/src/nix/run.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-05-05 18:59:33 +0200
committerEelco Dolstra <edolstra@gmail.com>2020-05-05 18:59:33 +0200
commit6f3244ce4517cc51ef3ffd39025152aa7046ef69 (patch)
tree588f8deb7406821d2d1157c310e15adde4001a61 /src/nix/run.cc
parent941f95284ab57e9baa317791327cf1715d8564b5 (diff)
parent909b4a882057a92ae8b40b8afdab3c4ac30da915 (diff)
Merge remote-tracking branch 'origin/master' into flakes
Diffstat (limited to 'src/nix/run.cc')
-rw-r--r--src/nix/run.cc20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nix/run.cc b/src/nix/run.cc
index f14e221e2..3e2c8b4f3 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
@@ -84,8 +84,8 @@ struct CmdShell : InstallablesCommand, RunCommon, MixEnvironment
{
return {
Example{
- "To start a shell providing GNU Hello from NixOS 17.03:",
- "nix shell -f channel:nixos-17.03 hello"
+ "To start a shell providing GNU Hello from NixOS 20.03:",
+ "nix shell nixpkgs/nixos-20.03#hello"
},
Example{
"To start a shell providing youtube-dl from your 'nixpkgs' channel:",