[nostalgia/gfx/studio,studio] Fix CLI tool output to only show usage if no args given
All checks were successful
Build / build (push) Successful in 1m19s
All checks were successful
Build / build (push) Successful in 1m19s
This commit is contained in:
@ -133,6 +133,9 @@ ox::Error cmdExportTilesheet(studio::Project &project, ox::SpanView<ox::CString>
|
||||
"[-scale <int>]\n");
|
||||
}
|
||||
};
|
||||
if (args.empty()) {
|
||||
return {};
|
||||
}
|
||||
OX_REQUIRE(srcPath, clargs.getString("src-path").transformError(1, "no src path specified"));
|
||||
OX_REQUIRE(dstPath, clargs.getString("dst-path").transformError(2, "no dst path specified"));
|
||||
auto const palPath = clargs.getString("pal-path", "");
|
||||
|
@ -90,7 +90,10 @@ static ox::Error run(
|
||||
return ox::Error{2, "failed to load project directory"};
|
||||
}
|
||||
Project project{*kctx.value, projectDir, projectDataDir};
|
||||
return c.func(project, args + numCmdArgs);
|
||||
return c.func(
|
||||
project,
|
||||
args.size() > numCmdArgs ?
|
||||
args + numCmdArgs : ox::SpanView<ox::CString>{});
|
||||
}
|
||||
}
|
||||
return ox::Error{1, "command not found"};
|
||||
|
Reference in New Issue
Block a user