mirror of
https://github.com/NixOS/nix.git
synced 2025-11-08 19:46:02 +01:00
Merge pull request #13499 from NixOS/mergify/bp/2.28-maintenance/pr-13496
Fix `nix help shell` by properly handling command aliases (backport #13496)
This commit is contained in:
commit
65f435708a
1 changed files with 8 additions and 0 deletions
|
|
@ -245,6 +245,14 @@ struct NixArgs : virtual MultiCommand, virtual MixCommonArgs, virtual RootArgs
|
|||
lowdown. */
|
||||
static void showHelp(std::vector<std::string> subcommand, NixArgs & toplevel)
|
||||
{
|
||||
// Check for aliases if subcommand has exactly one element
|
||||
if (subcommand.size() == 1) {
|
||||
auto alias = toplevel.aliases.find(subcommand[0]);
|
||||
if (alias != toplevel.aliases.end()) {
|
||||
subcommand = alias->second.replacement;
|
||||
}
|
||||
}
|
||||
|
||||
auto mdName = subcommand.empty() ? "nix" : fmt("nix3-%s", concatStringsSep("-", subcommand));
|
||||
|
||||
evalSettings.restrictEval = false;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue