repl: provide backward compat with legacy usage
This commit is contained in:
parent
7534798eed
commit
e1f308a1ec
|
@ -120,7 +120,7 @@ struct InstallablesCommand : virtual Args, SourceExprCommand
|
|||
|
||||
std::optional<FlakeRef> getFlakeRefForCompletion() override;
|
||||
|
||||
private:
|
||||
protected:
|
||||
|
||||
std::vector<std::string> _installables;
|
||||
};
|
||||
|
|
|
@ -895,6 +895,22 @@ struct CmdRepl : InstallablesCommand
|
|||
CmdRepl(){
|
||||
evalSettings.pureEval = false;
|
||||
}
|
||||
void prepare()
|
||||
{
|
||||
if (!settings.isExperimentalFeatureEnabled(Xp::Flakes) && !(file)) {
|
||||
warn("future versions of Nix will require using `--file` to load a file");
|
||||
if (this->_installables.size() > 1) {
|
||||
warn("more than one input file is not currently supported");
|
||||
}
|
||||
if (this->_installables.size() >= 1) {
|
||||
file = std::optional(
|
||||
this->_installables[0].data()
|
||||
);
|
||||
}
|
||||
_installables.clear();
|
||||
}
|
||||
installables = InstallablesCommand::load();
|
||||
}
|
||||
std::vector<std::string> files;
|
||||
Strings getDefaultFlakeAttrPaths() override
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue