New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: print warnings and allow error to be raised when unknown option is used #147
Conversation
… is used PACT-1370
|
||
From version 1.73.0, warnings will be printed for unknown options, and if the environment variable `PACT_BROKER_ERROR_ON_UNKNOWN_OPTION=true` is set, an error will be raised when an unknown option is used. | ||
|
||
In the next major version, an error will be raised by default. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice
stderr_lines = stderr.readlines | ||
end | ||
|
||
expect(stderr_lines.join("\n")).to include(unknown_switches_text) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's a shame it says unknown switches rather than unknown Option but this is still a much better experience
Usage:
pact-broker publish PACT_DIRS_OR_FILES ... -a, --consumer-app-version=CONSUMER_APP_VERSION -b, --broker-base-url=BROKER_BASE_URL
Options:
-a, --consumer-app-version=CONSUMER_APP_VERSIO
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, the terminology used inside the gem is very inconsistent. The words argument, option and switch are all used to mean the same thing in various places. I guess it's what happens when you have multiple people working on a project and you don't have a Terminology Dictator in control.
PACT-1370