Skip to content

Commit

Permalink
Slight cleanup of InstallablesCommand::load
Browse files Browse the repository at this point in the history
  • Loading branch information
Ericson2314 committed Feb 20, 2023
1 parent fa4733f commit 57a2e46
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/libcmd/installables.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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;
}

Expand Down

0 comments on commit 57a2e46

Please sign in to comment.