mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Merge pull request #13496 from k1gen/fix-help-shell-command
Fix `nix help shell` by properly handling command aliases
This commit is contained in:
commit
599c1d78ed
1 changed files with 8 additions and 0 deletions
|
|
@ -212,6 +212,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