aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/args.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-03 22:45:44 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-12-03 22:45:44 +0100
commitaf373c2ece2c14ac652313a6f370dc344c85f86e (patch)
treeeb6318cedfc19d16d6a3bc2f3a85fcfaebe3935c /src/libutil/args.cc
parent0c15ae5d4b3366a14bca885e02599a941a334920 (diff)
Add deprecated aliases for renamed commands
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r--src/libutil/args.cc5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 8bd9c8aeb..61f9503ec 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -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))