Slight cleanup of InstallablesCommand::load

This commit is contained in:
John Ericson 2023-02-03 22:02:39 -05:00
parent fa4733fce5
commit 57a2e46ee0

View file

@ -708,8 +708,8 @@ void InstallablesCommand::prepare()
installables = load(); installables = load();
} }
Installables InstallablesCommand::load() { Installables InstallablesCommand::load()
Installables installables; {
if (_installables.empty() && useDefaultInstallables()) if (_installables.empty() && useDefaultInstallables())
// FIXME: commands like "nix profile install" should not have a // FIXME: commands like "nix profile install" should not have a
// default, probably. // default, probably.
@ -719,11 +719,8 @@ Installables InstallablesCommand::load() {
std::vector<std::string> InstallablesCommand::getFlakesForCompletion() std::vector<std::string> InstallablesCommand::getFlakesForCompletion()
{ {
if (_installables.empty()) { if (_installables.empty() && useDefaultInstallables())
if (useDefaultInstallables()) return {"."};
return {"."};
return {};
}
return _installables; return _installables;
} }