[ox/clargs] Cleanup
All checks were successful
Build / build (push) Successful in 2m41s

This commit is contained in:
Gary Talent 2024-11-26 22:08:36 -06:00
parent dbbaaa46b9
commit 287d42f2b9

View File

@ -14,10 +14,10 @@ namespace ox {
ClArgs::ClArgs(int argc, const char **args) noexcept { ClArgs::ClArgs(int argc, const char **args) noexcept {
auto const argv = ox::SpanView{args, static_cast<size_t>(argc)}; auto const argv = ox::SpanView{args, static_cast<size_t>(argc)};
for (auto i = 0u; i < static_cast<unsigned>(argc); ++i) { for (auto i = 0u; i < static_cast<unsigned>(argc); ++i) {
auto arg = String(argv[i]); auto arg = StringView(argv[i]);
if (arg[0] == '-') { if (arg[0] == '-') {
while (arg[0] == '-' && arg.len()) { while (arg[0] == '-' && arg.len()) {
arg = arg.substr(1); arg = substr(arg, 1);
} }
m_bools[arg] = true; m_bools[arg] = true;
// parse additional arguments // parse additional arguments