diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-12-13 14:09:33 +0100 |
---|---|---|
committer | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2023-12-14 17:08:51 +0100 |
commit | 695728e4b5a77e39032a5fea4ef7abacf8a286af (patch) | |
tree | 09005e3e31b1a15732b4ab2d5884f1d98874e4cb /src | |
parent | ce29134d67e1af2c339936af73e4d6a82c8b337e (diff) | |
download | justbuild-695728e4b5a77e39032a5fea4ef7abacf8a286af.tar.gz |
just describe: Improve cli description and code documentation of --json option
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/common/cli.hpp | 4 | ||||
-rw-r--r-- | src/buildtool/main/describe.cpp | 2 |
2 files changed, 5 insertions, 1 deletions
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<CLI::App*> const& app, gsl::not_null<DescribeArguments*> 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; |