Skip to content

Restructure CLI into validate/run-tests/strictness-help subcommands#176

Open
drowaudio wants to merge 1 commit into
v2from
feature/sub_commands
Open

Restructure CLI into validate/run-tests/strictness-help subcommands#176
drowaudio wants to merge 1 commit into
v2from
feature/sub_commands

Conversation

@drowaudio
Copy link
Copy Markdown
Contributor

What

Restructures pluginval's command line into proper subcommands, with the old flat flags kept as deprecated aliases for one release:

New (canonical) Old (deprecated alias)
pluginval validate [options] <plugin> (the default) pluginval --validate <plugin>
pluginval run-tests pluginval --run-tests
pluginval strictness-help [level] pluginval --strictness-help [level]
pluginval <plugin> (bare-path shorthand) unchanged, stays silent

This was the work deliberately deferred from the CLI11 refactor (#175); the settings pipeline and PluginvalSettings were designed to be reused unchanged.

How

A thin verb dispatcher sits in front of the existing settings pipeline — not CLI11-native subcommands — so the env → --config → CLI precedence layering in parseTokens is completely untouched.

  • SettingsParser: split preprocess() into tokenise() + insertImplicitValidate(); added Command, DispatchResult and dispatch(), which peels the leading verb and records whether a deprecated alias was used.
  • The plugin path is now a positional CLI option (bound to the same member as --validate), so validate <plugin> works for file paths and AU component ids.
  • --config is stripped from the tokens fed to the CLI11 pass (it's parsed manually anyway) so its greedy vector parsing can't swallow the positional plugin path.
  • The parent→child handoff now uses the explicit verb: validate --config-base64 <b64> <path>.
  • CommandLine.cpp switches on the dispatched command and prints a one-line stderr deprecation notice when an old flat flag is used (the bare-path shorthand and the internal child handoff stay silent).

Deprecation behaviour

--validate / --run-tests / --strictness-help still work but emit e.g.:

!!! WARNING: --validate is deprecated; use 'pluginval validate <plugin>' instead. It will be removed in a future version.

To be removed in the release after next (noted in CHANGELIST.md).

Tests / verification

  • Added 6 CommandLineTests groups: positional validate, --config-before-plugin (the swallow guard), verb routing (no warning), deprecated aliases (warn), bare-path/child-handoff silence, and shouldPerformCommandLine verb recognition.
  • Full unit suite passes locally (run-tests, exit 0) and CI is green on all three platforms — including the Windows Run Pluginval Tests and Validate VST3 examples steps, plus all three "Pluginval as Dependency" jobs that exercise the updated AddPluginvalTests.cmake.

Also updated

  • .github/workflows/build.yaml — new syntax, keeping one --validate alias invocation (the continue-on-error AU step) so the deprecation path stays covered.
  • tests/AddPluginvalTests.cmake (public CTest module) and the CMakeLists.txt dev target → new validate syntax so downstream users don't get warnings.
  • tests/windows_tests.bat — replaced the stale --validate-in-process flag (no longer registered) with validate.
  • Docs (Command line options.md, Adding pluginval to CI.md — also fixed its broken --validate-in-process examples), CHANGELIST.md, and CLAUDE.md.

Reviewer notes

  • The --config token-stripping in parseTokens step 3 is the one non-obvious bit — it exists purely to stop CLI11's greedy vector parse from consuming the positional plugin path. --config is still parsed manually and still appears in --help.
  • --validate warns when used directly, but the internal child-process handoff uses the explicit validate verb so it never triggers the warning.

🤖 Generated with Claude Code

…nds, keeping flat flags as deprecated aliases`
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.

1 participant