1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 00:11:17 +02:00

Explain when man is missing

Have you seen this man?

Fixes #10677
This commit is contained in:
Robert Hensing 2024-07-05 18:32:34 +02:00
parent 8f280d72ff
commit 6ef00a503a
2 changed files with 7 additions and 0 deletions

View file

@ -320,6 +320,10 @@ void showManPage(const std::string & name)
restoreProcessContext();
setEnv("MANPATH", settings.nixManDir.c_str());
execlp("man", "man", name.c_str(), nullptr);
if (errno == ENOENT) {
// Not SysError because we don't want to suffix the errno, aka No such file or directory.
throw Error("The '%1%' command was not found, but it is needed for '%2%' and some other '%3%' commands' help text. Perhaps you could install the '%1%' command?", "man", name.c_str(), "nix-*");
}
throw SysError("command 'man %1%' failed", name.c_str());
}