diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2021-02-07 20:44:56 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2021-02-07 20:44:56 +0100 |
commit | 37352aa7e19e0bfebbd0c32985cbf79a83508538 (patch) | |
tree | a3c5086e8ad1945a37a233f1d759cb37f1715efc /src/libutil/args.cc | |
parent | 480426a364f09e7992230b32f2941a09fb52d729 (diff) |
Support --no-net for backwards compatibility
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r-- | src/libutil/args.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc index 71bae0504..9377fe4c0 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -14,6 +14,8 @@ void Args::addFlag(Flag && flag_) assert(flag->handler.arity == flag->labels.size()); assert(flag->longName != ""); longFlags[flag->longName] = flag; + for (auto & alias : flag->aliases) + longFlags[alias] = flag; if (flag->shortName) shortFlags[flag->shortName] = flag; } @@ -191,6 +193,7 @@ nlohmann::json Args::toJSON() for (auto & [name, flag] : longFlags) { auto j = nlohmann::json::object(); + if (flag->aliases.count(name)) continue; if (flag->shortName) j["shortName"] = std::string(1, flag->shortName); if (flag->description != "") |