some fixes

This commit is contained in:
Mars 2025-05-11 22:12:36 -04:00
parent fe7e940d87
commit 6dfaeb9acf
3 changed files with 14 additions and 15 deletions

View file

@ -20,14 +20,16 @@ namespace {
using util::types::i32, util::types::CStr;
fn getOrdinalSuffix(const i32 day) -> CStr {
using matchit::match, matchit::is, matchit::_, matchit::in;
using matchit::match, matchit::is, matchit::_, matchit::or_;
if (day == 11 || day == 12 || day == 13)
return "th";
return match(day % 10)(
is | in(11, 13) = "th",
is | 1 = "st",
is | 2 = "nd",
is | 3 = "rd",
is | _ = "th"
is | 1 = "st",
is | 2 = "nd",
is | 3 = "rd",
is | _ = "th"
);
}

View file

@ -40,13 +40,13 @@ fn main(const i32 argc, char* argv[]) -> i32 try {
.help("Enable verbose logging. Overrides --log-level.")
.flag();
if (Result result = parser.parse_args(argc, argv); !result) {
if (Result<> result = parser.parse_args(argc, argv); !result) {
error_at(result.error());
return EXIT_FAILURE;
}
bool verbose = parser.get<bool>("-V").value_or(false) || parser.get<bool>("--verbose").value_or(false);
Result logLevelStr = verbose ? "debug" : parser.get<String>("--log-level");
Result<String> logLevelStr = verbose ? "debug" : parser.get<String>("--log-level");
{
using matchit::match, matchit::is, matchit::_;

View file

@ -1,10 +1,7 @@
[wrap-file]
directory = SQLiteCpp-3.3.2
source_url = https://github.com/SRombauts/SQLiteCpp/archive/refs/tags/3.3.2.zip
source_filename = sqlitecpp-3.3.2.zip
source_hash = 1f41ef7322da573fdfca95655bd1329282638b4d9d3dc16a48f4bad16008eda8
source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/sqlitecpp_3.3.2-1/sqlitecpp-3.3.2.zip
wrapdb_version = 3.3.2-1
[wrap-git]
url = https://github.com/SRombauts/SQLiteCpp.git
revision = HEAD
directory = SQLiteCpp
[provide]
sqlitecpp = sqlitecpp_dep