nix app: Accept arguments

Example:

  $ nix app blender-bin -- --version
  Blender 2.80 (sub 74)
This commit is contained in:
Eelco Dolstra 2019-06-17 17:05:37 +02:00
parent 2467c98375
commit 0d69f7f3f0
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE

View file

@ -196,8 +196,11 @@ static RegisterCommand r1(make_ref<CmdRun>());
struct CmdApp : InstallableCommand, RunCommon struct CmdApp : InstallableCommand, RunCommon
{ {
std::vector<std::string> args;
CmdApp() CmdApp()
{ {
expectArgs("args", &args);
} }
std::string name() override std::string name() override
@ -238,7 +241,10 @@ struct CmdApp : InstallableCommand, RunCommon
state->realiseContext(app.context); state->realiseContext(app.context);
runProgram(store, app.program, {app.program}); Strings allArgs{app.program};
for (auto & i : args) allArgs.push_back(i);
runProgram(store, app.program, allArgs);
} }
}; };