feat(cli): add a studio subcommand behind the studio feature - #459
Merged
Merged
Conversation
The studio shipped as a second binary, so a CLI built with `--features studio` answered `unrecognized subcommand 'studio'` to the one name a user would try first. `rustmotion studio` now opens it, with the same `-f` / `-d` as `rustmotion-studio`, which stays installed for anyone who scripted it. Without the feature the variant is still compiled, hidden from `--help` per the rule already in CLAUDE.md, and dispatched to the `cargo install --features studio` line. A subcommand that names the flag granting it is the whole reason the report came in; `unrecognized subcommand` names nothing. `studio::run` parsed its own argv, which would have choked on the `studio` token, so the body moved to `run_with(file, dir)` and both entrypoints call it. `studio::command()` had no caller and went with it. Closes #458
Merged
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.
cargo install --features studiobuilt the studio but left it reachable only as a second binary, so the first name anyone tries —rustmotion studio— answeredunrecognized subcommand. That is what a user reported.rustmotion studionow opens it, taking the same-f/-dasrustmotion-studio. The standalone binary is unchanged and still installed by the same feature; removing it would break anyone who scripted it, and it costs four lines.The variant is compiled either way, and
#[cfg_attr(not(feature = "studio"), command(hide = true))]keeps it out of--helpwhen the feature is off, which is what CLAUDE.md asks for. Typing it anyway then gets:Gating the variant out entirely was the other option and was rejected: it produces
unrecognized subcommand 'studio', which is the message that caused the report. A hidden subcommand advertises nothing and still explains itself.studio::runcalledCli::parse()on the process argv, which would have failed on thestudiotoken, so its body moved torun_with(file, dir)and both entrypoints call that.studio::command()had no caller anywhere in the repo and was removed.Verification —
tests/studio_subcommand.rsdrives the built binary and splits on the feature: with it,studiois in the subcommand list andstudio --helpcarries--fileand--dir; without it, nostudioline in--help, andrustmotion studioexits non-zero naming--features studioand notunrecognized subcommand. Run both ways, pluscargo fmt --all --check,cargo clippy --workspace --all-targetswith and without--features rustmotion/studio, andcargo test --workspace --features rustmotion/studio(0 failed). CI only runs clippy with the feature on, so the feature-off branch was checked locally.Closes #458