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