mirror of
https://github.com/NixOS/nix
synced 2025-06-28 17:51:15 +02:00
Merge remote-tracking branch 'upstream/master' into errors-phase-2
This commit is contained in:
commit
ef1b3f21b6
42 changed files with 261 additions and 92 deletions
|
@ -217,10 +217,15 @@ MultiCommand::MultiCommand(const Commands & commands)
|
|||
{
|
||||
expectedArgs.push_back(ExpectedArg{"command", 1, true, [=](std::vector<std::string> ss) {
|
||||
assert(!command);
|
||||
auto i = commands.find(ss[0]);
|
||||
auto cmd = ss[0];
|
||||
if (auto alias = get(deprecatedAliases, cmd)) {
|
||||
warn("'%s' is a deprecated alias for '%s'", cmd, *alias);
|
||||
cmd = *alias;
|
||||
}
|
||||
auto i = commands.find(cmd);
|
||||
if (i == commands.end())
|
||||
throw UsageError("'%s' is not a recognised command", ss[0]);
|
||||
command = {ss[0], i->second()};
|
||||
throw UsageError("'%s' is not a recognised command", cmd);
|
||||
command = {cmd, i->second()};
|
||||
}});
|
||||
|
||||
categories[Command::catDefault] = "Available commands";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue