aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/args.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2020-12-07 13:04:24 +0100
committerEelco Dolstra <edolstra@gmail.com>2020-12-21 13:32:23 +0100
commit346baec783a7423aa5b6cacaf7eebb8d22d4ce79 (patch)
treef09bcc9887b22a172a197d2394db357e4972682a /src/libutil/args.cc
parent9fab14adbc3810d5cc1f88672fde1eee4358405c (diff)
Move doc() to Args
Diffstat (limited to 'src/libutil/args.cc')
-rw-r--r--src/libutil/args.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libutil/args.cc b/src/libutil/args.cc
index 61f9503ec..a929ea5ac 100644
--- a/src/libutil/args.cc
+++ b/src/libutil/args.cc
@@ -254,6 +254,8 @@ nlohmann::json Args::toJSON()
res["description"] = description();
res["flags"] = std::move(flags);
res["args"] = std::move(args);
+ auto s = doc();
+ if (s != "") res.emplace("doc", stripIndentation(s));
return res;
}
@@ -378,8 +380,6 @@ nlohmann::json Command::toJSON()
auto res = Args::toJSON();
res["examples"] = std::move(exs);
- auto s = doc();
- if (s != "") res.emplace("doc", stripIndentation(s));
return res;
}