Repository navigation
fix(cli): reject repeated --out/--render/--draw instead of dropping paths - #136
Open
farisbasha wants to merge 1 commit into
Open
farisbasha wants to merge 1 commit into
farisbasha wants to merge 1 commit into
Conversation
…aths A second --out (or --render/--draw) replaced the first one, so `forma eval --out a.stl --out b.glb` wrote only b.glb and said nothing. Exit 2 with both paths instead, like an extra input file already does.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CLI keeps only the last value of a repeated output flag, without a warning:
The same happens for
--render,--draw, and--outonforma render/forma draw. An extra input file is already rejected ("only one script file is accepted"), so a dropped output path is the odd one out, and an agent that asks for two formats this way gets one without noticing.Fix
Output paths are set through a small
set_path_oncehelper. A second value for the same output exits with code 2 (invalid CLI usage) before anything is evaluated or written:Using
--out,--renderand--drawonce each together still works.Tests
repeated_output_flags_are_rejected_instead_of_droppedincrates/forma-cli/tests/cli_exit_codes.rs: repeated--out/-o/--render/--drawandforma render --outexit 2 and write nothing; one of each flag still writes all three files. It fails onmainand passes with the change.cargo test --locked --release -p forma-core -p forma-lang -p forma-cli -p forma-mcp -p forma-server -- --skip test_10000_fuzzed_modeling_operations_zero_crashes_zero_nans: 158 passed, 0 failed (Linux).This PR was prepared with AI assistance (Claude).