Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tools/VersionMain.cpp
diff options
context:
space:
mode:
authorLeitwolf2026-11-15 13:53:40 +0300
committerGitHub2026-11-15 13:53:40 +0300
commit9ea8d3a88334d62711f3e9aa429c7fe4905f2ef0 (patch)
tree7a4c0aa03d636bea6a359cd6fe9501bb5c8db28e /tools/VersionMain.cpp
parent13ecce487c3075e4ccc2f62b9c08597459d1a268 (diff)
parent8979c1caf2eee321cf497671805d2177980c421e (diff)
downloadcatch3-9ea8d3a88334d62711f3e9aa429c7fe4905f2ef0.tar.gz
Merge branch 'devel' into docs/no-former-languagedocs/no-former-language
Diffstat (limited to 'tools/VersionMain.cpp')
-rw-r--r--tools/VersionMain.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/tools/VersionMain.cpp b/tools/VersionMain.cpp
index 6f1c13cb..2c9c5456 100644
--- a/tools/VersionMain.cpp
+++ b/tools/VersionMain.cpp
@@ -2,8 +2,8 @@
// SPDX-License-Identifier: MPL-2.0 WITH AdditionRef-Progmasoft-Exception-2.0
// bazelisk run //tools:version prints the current version
-// bazelisk run //tools:version -- --next moves to the next version
-// bazelisk run //tools:version -- 0.3.1.0 moves to that version
+// bazelisk run //tools:version -- --next moves to the next patch release
+// bazelisk run //tools:version -- 0.4.0 moves to that version
//
// Moving writes every place that states the version, and the amalgamation.
@@ -44,16 +44,19 @@ main(int argc, char **argv)
return 0;
}
const std::string_view argument{ argv[1] };
- const auto parsed = ParseVersion(
- argument == "--next" ? *current : std::string{ argument });
+ const auto parsed
+ = argument == "--next" ? NextPatch(*current) : ParseVersion(argument);
if (!parsed)
{
- std::cerr << "not a version of three or four numbers: " << argument
+ std::cerr << (argument == "--next"
+ ? "the current version is not a release version: "
+ + *current
+ : "not a version MAJOR.MINOR.PATCH: "
+ + std::string{ argument })
<< '\n';
return 2;
}
- const auto version
- = FormatVersion(argument == "--next" ? NextVersion(*parsed) : *parsed);
+ const auto version = FormatVersion(*parsed);
// The sources have to make a distribution before anything is changed.
(void)GenerateAmalgamation(*root, problems);
if (problems.empty())