diff --git a/src/libcmd/command.hh b/src/libcmd/command.hh index bd2a0a7ee..fac48c86d 100644 --- a/src/libcmd/command.hh +++ b/src/libcmd/command.hh @@ -156,7 +156,7 @@ struct InstallableCommand : virtual Args, SourceExprCommand std::optional getFlakeRefForCompletion() override { - return parseFlakeRef(_installable, absPath(".")); + return parseFlakeRefWithFragment(_installable, absPath(".")).first; } private: diff --git a/src/libcmd/installables.cc b/src/libcmd/installables.cc index 644954977..8fd598aed 100644 --- a/src/libcmd/installables.cc +++ b/src/libcmd/installables.cc @@ -904,10 +904,10 @@ std::optional InstallablesCommand::getFlakeRefForCompletion() { if (_installables.empty()) { if (useDefaultInstallables()) - return parseFlakeRef(".", absPath(".")); + return parseFlakeRefWithFragment(".", absPath(".")).first; return {}; } - return parseFlakeRef(_installables.front(), absPath(".")); + return parseFlakeRefWithFragment(_installables.front(), absPath(".")).first; } InstallableCommand::InstallableCommand()