1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 17:51:15 +02:00

repl: allow loading installables from CLI

repl: search installable with findAlongAttrPath
repl: refactor handling of args
repl: temp
This commit is contained in:
Tom Bereknyei 2022-02-18 18:33:03 -05:00
parent 06d57ce759
commit 81567a0962
3 changed files with 55 additions and 38 deletions

View file

@ -132,6 +132,7 @@ struct InstallableCommand : virtual Args, SourceExprCommand
InstallableCommand(bool supportReadOnlyMode = false);
void prepare() override;
std::shared_ptr<Installable> load();
std::optional<FlakeRef> getFlakeRefForCompletion() override
{

View file

@ -1054,10 +1054,13 @@ InstallableCommand::InstallableCommand(bool supportReadOnlyMode)
}}
});
}
std::shared_ptr<Installable> InstallableCommand::load() {
return parseInstallable(getStore(), _installable);
}
void InstallableCommand::prepare()
{
installable = parseInstallable(getStore(), _installable);
installable = load();
}
}