You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Redocly interprets that last argument as a config file.
I found a work-around wherein if I add a -- to the end of the command, Redocly lint ignores anything after it!
Describe the solution you'd like
Pretty simply: Can you confirm that is indeed the expected and supported behaviour, or am I doing some spacebar heating? If it is supported, can it be called out in the docs?
Describe alternatives you've considered
Possibly could wrap it in my own shell script that throws away args.
Additional context
If the above is not clear, I'd be happy to provide a minimum reproduction by way of a small example repository.
The text was updated successfully, but these errors were encountered:
Hi @collinsauve! The behaviour is not specific to Redocly CLI, it's how yargs (which is used as the arguments processor here) handles the input. I'm not sure we need to document that though, since the behaviour is pretty common.
Thanks for the confirmation that this is expected behavior. My primary concern was that I was relying on something unsupported.
Unfortunately I also don't see this in yargs docs. I used this only because, as you say it is a common pattern. Not going to push too hard on getting it documented now that it is confirmed here.
Thanks @collinsauve I think your usage is the right way to use the -- command. I'm going to close this issue since it's both familiar and also from an upstream repository, so I don't think there's further action for us to take.
Is your feature request related to a problem? Please describe.
We use pre-commit to automatically hook up a number of linters to our repository.
This tool sends the files that are to be commited as extra command-line arguments to redocly. By way of example, I use a pre-commit config like this:
Unfortunately due to the above pre-commit behaviour of sending the changed files, the actual command will be sent like this:
Redocly interprets that last argument as a config file.
I found a work-around wherein if I add a
--
to the end of the command, Redocly lint ignores anything after it!Describe the solution you'd like
Pretty simply: Can you confirm that is indeed the expected and supported behaviour, or am I doing some spacebar heating? If it is supported, can it be called out in the docs?
Describe alternatives you've considered
Possibly could wrap it in my own shell script that throws away args.
Additional context
If the above is not clear, I'd be happy to provide a minimum reproduction by way of a small example repository.
The text was updated successfully, but these errors were encountered: