From 484ce778d6fdfe88767b8d23c8f8e1a7ee7805a4 Mon Sep 17 00:00:00 2001 From: Klaus Aehlig Date: Tue, 9 Jan 2024 12:10:40 +0100 Subject: just-mr: don't make the command line pretend a fixed name Our fetch and launch tool is parametric in the tool to be launched. Reflect this in the documentation and do not pretend it to be the name "just" hard coded. While there, also fix the hard-coded name "git" in the documentation of the default value. (cherry picked from commit e15f11ce0a7813602d9627e95ae9fb125afa891e) --- CHANGELOG.md | 2 ++ share/man/just-mr.1.md | 3 +-- src/other_tools/just_mr/cli.hpp | 8 ++++++-- src/other_tools/just_mr/main.cpp | 16 +++++++++------- 4 files changed, 18 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 675fac17..91167bd9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,8 @@ Bug fixes on top of release `1.2.4`. - Child processes are now properly waited for in all circumstances. - Bootstrapping is now also supported if the build directory resides in the source tree. +- `just-mr` now reports the name of the build tool correctly, even + if not called `just`. ## Release `1.2.4` (2023-12-19) diff --git a/share/man/just-mr.1.md b/share/man/just-mr.1.md index 655ccdd4..a526f2dd 100644 --- a/share/man/just-mr.1.md +++ b/share/man/just-mr.1.md @@ -3,8 +3,7 @@ NAME ==== -just-mr - multi-repository configuration tool and launcher for -**`just`**(1) +just-mr - multi-repository configuration tool and launcher for the build tool SYNOPSIS ======== diff --git a/src/other_tools/just_mr/cli.hpp b/src/other_tools/just_mr/cli.hpp index 48c06fb8..d7390db2 100644 --- a/src/other_tools/just_mr/cli.hpp +++ b/src/other_tools/just_mr/cli.hpp @@ -136,7 +136,10 @@ static inline void SetupMultiRepoCommonArguments( "CA certificate bundle to use for SSL verification when fetching " "archives from remote.") ->type_name("CA_BUNDLE"); - app->add_option("--just", clargs->just_path, "Path to the just binary.") + app->add_option("--just", + clargs->just_path, + fmt::format("The build tool to be launched (default: {}).", + kDefaultJustPath)) ->type_name("PATH"); app->add_option("--main", clargs->main, @@ -152,7 +155,8 @@ static inline void SetupMultiRepoCommonArguments( ->type_name("RCFILE"); app->add_option("--git", clargs->git_path, - "Path to the git binary. (Default: \"git\")") + fmt::format("Path to the git binary. (Default: {})", + kDefaultGitPath)) ->type_name("PATH"); app->add_flag("--norc", clargs->norc, "Do not use any just-mrrc file."); app->add_option("-j, --jobs", diff --git a/src/other_tools/just_mr/main.cpp b/src/other_tools/just_mr/main.cpp index d11785b3..8ee8e72e 100644 --- a/src/other_tools/just_mr/main.cpp +++ b/src/other_tools/just_mr/main.cpp @@ -93,12 +93,13 @@ void SetupSetupCommandArguments( [[nodiscard]] auto ParseCommandLineArguments(int argc, char const* const* argv) -> CommandLineArguments { CLI::App app( - "just-mr, a multi-repository configuration tool and launcher for just"); + "just-mr, a multi-repository configuration tool and launcher for the " + "build tool"); app.option_defaults()->take_last(); auto* cmd_mrversion = app.add_subcommand( "mrversion", "Print version information in JSON format of this tool."); - auto* cmd_setup = - app.add_subcommand("setup", "Setup and generate just configuration"); + auto* cmd_setup = app.add_subcommand( + "setup", "Setup and generate configuration for the build tool"); auto* cmd_setup_env = app.add_subcommand( "setup-env", "Setup without workspace root for the main repository."); auto* cmd_fetch = @@ -107,15 +108,16 @@ void SetupSetupCommandArguments( "update", "Advance Git commit IDs and print updated just-mr configuration."); auto* cmd_do = app.add_subcommand( - "do", "Canonical way of specifying just subcommands."); + "do", "Canonical way of specifying subcommands to be launched."); cmd_do->set_help_flag(); // disable help flag // define just subcommands std::vector cmd_just_subcmds{}; cmd_just_subcmds.reserve(kKnownJustSubcommands.size()); for (auto const& known_subcmd : kKnownJustSubcommands) { - auto* subcmd = app.add_subcommand( - known_subcmd.first, - "Run setup and call \"just " + known_subcmd.first + "\"."); + auto* subcmd = + app.add_subcommand(known_subcmd.first, + "Run setup and launch the \"" + + known_subcmd.first + "\" subcommand."); subcmd->set_help_flag(); // disable help flag cmd_just_subcmds.emplace_back(subcmd); } -- cgit v1.2.3