mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-27 08:16:14 +02:00
nix app: Accept arguments
Example: $ nix app blender-bin -- --version Blender 2.80 (sub 74)
This commit is contained in:
parent
2467c98375
commit
0d69f7f3f0
1 changed files with 7 additions and 1 deletions
|
@ -196,8 +196,11 @@ static RegisterCommand r1(make_ref<CmdRun>());
|
|||
|
||||
struct CmdApp : InstallableCommand, RunCommon
|
||||
{
|
||||
std::vector<std::string> args;
|
||||
|
||||
CmdApp()
|
||||
{
|
||||
expectArgs("args", &args);
|
||||
}
|
||||
|
||||
std::string name() override
|
||||
|
@ -238,7 +241,10 @@ struct CmdApp : InstallableCommand, RunCommon
|
|||
|
||||
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);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue