mirror of
https://github.com/NixOS/nix
synced 2025-06-28 13:41:15 +02:00
Add deprecated aliases for renamed commands
This commit is contained in:
parent
0c15ae5d4b
commit
af373c2ece
3 changed files with 33 additions and 7 deletions
|
@ -86,6 +86,7 @@ void Args::parseCmdline(const Strings & _cmdline)
|
|||
throw UsageError("unrecognised flag '%1%'", arg);
|
||||
}
|
||||
else {
|
||||
pos = rewriteArgs(cmdline, pos);
|
||||
pendingArgs.push_back(*pos++);
|
||||
if (processArgs(pendingArgs, false))
|
||||
pendingArgs.clear();
|
||||
|
@ -390,10 +391,6 @@ MultiCommand::MultiCommand(const Commands & commands)
|
|||
.optional = true,
|
||||
.handler = {[=](std::string s) {
|
||||
assert(!command);
|
||||
if (auto alias = get(deprecatedAliases, s)) {
|
||||
warn("'%s' is a deprecated alias for '%s'", s, *alias);
|
||||
s = *alias;
|
||||
}
|
||||
if (auto prefix = needsCompletion(s)) {
|
||||
for (auto & [name, command] : commands)
|
||||
if (hasPrefix(name, *prefix))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue