mirror of
https://github.com/NixOS/nix
synced 2025-06-28 13:41:15 +02:00
Group subcommands by category
This commit is contained in:
parent
3ba98ba8f0
commit
807d963ee8
3 changed files with 32 additions and 6 deletions
|
@ -341,7 +341,10 @@ nlohmann::json MultiCommand::toJSON()
|
|||
for (auto & [name, commandFun] : commands) {
|
||||
auto command = commandFun();
|
||||
auto j = command->toJSON();
|
||||
j["category"] = categories[command->category()];
|
||||
auto cat = nlohmann::json::object();
|
||||
cat["id"] = command->category();
|
||||
cat["description"] = categories[command->category()];
|
||||
j["category"] = std::move(cat);
|
||||
cmds[name] = std::move(j);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue