From 7461d832b639d5718e45c317f733621f527d07ca Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Thu, 24 Jul 2025 21:16:38 -0500 Subject: [PATCH] [nostalgia/gfx/studio,studio] Fix CLI tool output to only show usage if no args given --- .../studio/subcommands/export-tilesheet/export-tilesheet.cpp | 3 +++ src/olympic/studio/applib/src/app.cpp | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/nostalgia/modules/gfx/src/studio/subcommands/export-tilesheet/export-tilesheet.cpp b/src/nostalgia/modules/gfx/src/studio/subcommands/export-tilesheet/export-tilesheet.cpp index 03f510ba..31c0ce37 100644 --- a/src/nostalgia/modules/gfx/src/studio/subcommands/export-tilesheet/export-tilesheet.cpp +++ b/src/nostalgia/modules/gfx/src/studio/subcommands/export-tilesheet/export-tilesheet.cpp @@ -133,6 +133,9 @@ ox::Error cmdExportTilesheet(studio::Project &project, ox::SpanView "[-scale ]\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", ""); diff --git a/src/olympic/studio/applib/src/app.cpp b/src/olympic/studio/applib/src/app.cpp index 6729bc12..186d84f9 100644 --- a/src/olympic/studio/applib/src/app.cpp +++ b/src/olympic/studio/applib/src/app.cpp @@ -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{}); } } return ox::Error{1, "command not found"};