From 695728e4b5a77e39032a5fea4ef7abacf8a286af Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Wed, 13 Dec 2023 14:09:33 +0100 Subject: just describe: Improve cli description and code documentation of --json option --- src/buildtool/common/cli.hpp | 4 +++- src/buildtool/main/describe.cpp | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index b1633716..387092bc 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -324,7 +324,9 @@ static inline auto SetupAnalysisArguments( static inline auto SetupDescribeArguments( gsl::not_null const& app, gsl::not_null const& clargs) { - app->add_flag("--json", clargs->print_json, "Print description as JSON."); + app->add_flag("--json", + clargs->print_json, + "Omit pretty-printing and describe rule in JSON format."); app->add_flag("--rule", clargs->describe_rule, "Positional arguments refer to rule instead of target."); diff --git a/src/buildtool/main/describe.cpp b/src/buildtool/main/describe.cpp index 07a8febc..18836bf6 100644 --- a/src/buildtool/main/describe.cpp +++ b/src/buildtool/main/describe.cpp @@ -296,6 +296,8 @@ auto DescribeTarget(BuildMaps::Target::ConfiguredTarget const& id, } if (BuildMaps::Target::IsBuiltInRule(*rule_it)) { if (print_json) { + // For built-in rules, we have no user-defined description to + // provide other than informing the user that it is a built-in rule. std::cout << nlohmann::json({{"type", *rule_it}}).dump(2) << std::endl; return kExitSuccess; -- cgit v1.2.3