diff options
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r-- | src/libutil/args.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc index ad83a2414..147602415 100644 --- a/src/libutil/args.cc +++ b/src/libutil/args.cc @@ -359,12 +359,14 @@ nlohmann::json Command::toJSON() for (auto & example : examples()) { auto ex = nlohmann::json::object(); ex["description"] = example.description; - ex["command"] = example.command; + ex["command"] = chomp(stripIndentation(example.command)); exs.push_back(std::move(ex)); } auto res = Args::toJSON(); res["examples"] = std::move(exs); + auto s = doc(); + if (s != "") res.emplace("doc", stripIndentation(s)); return res; } |