[applib] Make run take args as a SpanView

This commit is contained in:
2024-11-28 00:51:42 -06:00
parent edda8e010e
commit 1bf4f246c2
6 changed files with 24 additions and 20 deletions

View File

@ -9,7 +9,9 @@ namespace keel {
static ox::Vector<Module const*> mods;
void registerModule(Module const*mod) noexcept {
mods.emplace_back(mod);
if (mod) {
mods.emplace_back(mod);
}
}
[[nodiscard]]

View File

@ -81,8 +81,8 @@ static ox::Error pack(
return {};
}
static ox::Error run(int argc, char const**argv, ox::StringView projectDataDir) noexcept {
ox::ClArgs const args(argc, argv);
static ox::Error run(ox::SpanView<char const*> argv, ox::StringView projectDataDir) noexcept {
ox::ClArgs const args(argv);
auto const argSrc = args.getString("src", "");
auto const argRomBin = args.getString("rom-bin", "");
auto const argManifest = args.getString("manifest", "");
@ -103,9 +103,8 @@ ox::Error run(
[[maybe_unused]] ox::StringView project,
[[maybe_unused]] ox::StringView appName,
ox::StringView projectDataDir,
int argc,
char const**argv) noexcept {
return ::run(argc, argv, projectDataDir);
ox::SpanView<char const*> argv) noexcept {
return ::run(argv, projectDataDir);
}
}