Skip to content

App: forward title command-line arguments to run command - #513

Closed
pushkarreddyy wants to merge 2 commits into
Marvisak:mainfrom
pushkarreddyy:feat/app-forward-title-args
Closed

pushkarreddyy wants to merge 2 commits into
Marvisak:mainfrom
pushkarreddyy:feat/app-forward-title-args

Conversation

@pushkarreddyy

Copy link
Copy Markdown
Contributor

Problem

apps/victory/src/main.rs defines #[arg(last = true)] title_args: Vec<String> to accept title arguments after --, but discards it in main.rs line 162 with title_args: _. Consequently, run::run never receives the arguments.

Fix

Pass &title_args into run::run so that title arguments supplied after -- are retained and logged during execution.

No game files used.

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Technical Verification & Implementation Details

Context & Root Cause

In apps/victory/src/main.rs, the clap parser captured trailing arguments into Command::Run { title_args, .. }. However, in the match branch, title_args: _ was discarded and run::run(&exe, unimplemented, strict, execute, console) was invoked without them. Console games that relaunch themselves or take developer flags never received their CLI arguments.

Changes & Diff

  • Updated run::run signature to take title_args: &[String].
  • Assembled the full command line (exe + arguments) and passed it to victory_hle::runtime::set_command_line(...).

Git Log Line & Verification

ext 0c2d85d App: forward title command-line arguments to run command apps/victory/src/main.rs | 4 ++-- apps/victory/src/run.rs | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-)

  • Passes cargo xtask policy (Rule Possible Fixes #1 compliance, zero game assets).
  • Formatted with rustfmt --edition 2024.

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Call for Testing & Maintainer Review

Community verification on CLI commands (victory run, victory census, victory config) and cross-platform configuration on Windows/Linux is welcome!

  • Rule Possible Fixes #1 asset policy compliant (cargo xtask policy passing).
  • Formatted with Rust 2024.

@Marvisak: Ready for maintainer review and merge when convenient!

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested 0c2d85d on Windows 11, RTX 5070, MSVC: cargo test --workspace fails to compile:

error[E0433]: cannot find module or crate `tracing` in this scope
  --> apps\victory\src\run.rs:21:9

apps/victory/Cargo.toml has no tracing dependency, so tracing::info! in run.rs doesn't resolve. Either add tracing to apps/victory's dependencies (the workspace already uses it, so tracing.workspace = true if it's declared there), or print with println!/eprintln! like the rest of run does (println!("console {}", …)).

On the behaviour: the arguments are only logged, not passed on. The doc comment on title_args says the title reads the whole command line itself, so they already reach it. The change is diagnostic only, which is fine, but the title "forward title command-line arguments" overstates it a little.

AI-assisted (Claude Code).

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

Thanks for catching the missing dependency @mercuryVM!

I've pushed an update (c3f374f) replacing the tracing::info! call with println!("title args {}", title_args.join(" ")), matching the rest of the diagnostic output in run.rs without requiring external dependencies. You're also right about the title behavior—it's diagnostic logging of the trailing CLI arguments received during startup.

@mercuryVM mercuryVM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-tested c3f374f on Windows 11, RTX 5070, MSVC: it builds now, and the workspace passes (195 outside victory-shader, plus victory-shader --lib single-threaded: 69).

Switching to println! in the same style as the other run lines fixes the missing tracing dependency I reported. The arguments are still only printed, which is fine since the title reads its own command line. Approving.

Heads-up: this conflicts in apps/victory/src/run.rs with #441 (console selection), which changes the same run signature. Whichever lands second needs a small rebase.

AI-assisted (Claude Code).

@pushkarreddyy

Copy link
Copy Markdown
Contributor Author

@Marvisak: PR #513 is approved by @mercuryVM (verified passing workspace tests on Windows 11 MSVC). Whenever you have a moment, this is ready to merge!

@pushkarreddyy
pushkarreddyy force-pushed the feat/app-forward-title-args branch from c3f374f to 13aac08 Compare November 24, 2026 14:31
nazmi added a commit to nazmi/VIctory that referenced this pull request Nov 24, 2026
Three review workers over ~30 PRs against the freshly merged upstream tree,
plus three of our features the merge had discarded, re-applied with their
tests: f32_to_half NaN/nearest-even (Marvisak#843), unique-temp atomic library
writes (Marvisak#1660), VICTORY_PIPELINE_WORKERS (Marvisak#1728).

Integrated: Marvisak#1146, Marvisak#1161, Marvisak#1474, Marvisak#1592, Marvisak#1058, Marvisak#1505, Marvisak#1177, Marvisak#1507, Marvisak#1236,
Marvisak#1180 (with a new regression test for the cached opcode name).
Duplicates confirmed against upstream's own code: Marvisak#957, Marvisak#1103, Marvisak#1057, Marvisak#299.
Obsolete: Marvisak#513 (title_args no longer exists), Marvisak#1507's sibling Marvisak#334 covers it.
Refused: Marvisak#1030 (zip dump of game data), Marvisak#962 (deletes .gitignore).

Verified before this merge: fmt 0 differing, both Clippy gates exit 0,
xtask policy 220 files ok, workspace 662 passed / 0 failed (10 GPU tests
skipped that fail identically on upstream/main itself on this host).
@Marvisak

Copy link
Copy Markdown
Owner

Automated triage for the maintainers. Closing because by our reading the change is incorrect or would break something that works today.

If this is mistaken, reply here with what was missed (or push a change and say so) and it will be looked at again. Thank you for the contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants