pluginval icon indicating copy to clipboard operation
pluginval copied to clipboard

Cannot use --arg=value style of CLI args

Open falkTX opened this issue 2 years ago • 2 comments

It is typical for CLI tools to accept both --arg=value and --arg value style of CLI arguments, but pluginval fails here. If using something like getopt this is handled for us, seems weird to not have this working.

So here is a request for such functionality.

Complete CLI output for posterity:

% pluginval --strictness-level=10 ...
JUCE v7.0.1
Missing strictness level argument! (Must be between 1 - 10)

PS: tool does not close when provided CLI args are not recognized, I need to use Ctrl+C to stop it.

falkTX avatar Aug 09 '22 23:08 falkTX

I'm using juce::ArgumentList for this which actually defaults to the --arg=value style but I'm not really a fan because it makes it more complex to pass multiple arguments. So I actually provide a work around to add back the --arg value style as it was more familiar to me and how man pages are usually displayed.

I don't think Windows natively comes with getopt and the API looks a bit verbose for what I needed. Maybe an approach that would work would be to use the standard juce::ArgumentList approach which works with --arg=value but parse the passed in command line to add any missing = to get it in to that form. That might work.

PS: tool does not close when provided CLI args are not recognized, I need to use Ctrl+C to stop it. Thanks, I'll add this to the list to look in to.

drowaudio avatar Aug 10 '22 10:08 drowaudio

PS: tool does not close when provided CLI args are not recognized, I need to use Ctrl+C to stop it.

Fixed here: https://github.com/Tracktion/pluginval/commit/bdd5f6aa1406d418a5c6de790e7c08e62edc4364

drowaudio avatar Aug 10 '22 10:08 drowaudio