Skip to content
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

Use exit code in addition of print for "test" #85

Merged
merged 1 commit into from
Dec 11, 2019
Merged

Use exit code in addition of print for "test" #85

merged 1 commit into from
Dec 11, 2019

Conversation

kerneis
Copy link
Contributor

@kerneis kerneis commented Dec 10, 2019

The documentation mentions that "oauth2l test" returns 0 or 1, but the
current code prints the value instead of setting an exit code. This is
not useful for scripting.

This commit still keeps the printing part for backwards-compatibility
reasons.

The documentation mentions that "oauth2l test" returns 0 or 1, but the
current code prints the value instead of setting an exit code. This is
not useful for scripting.

This commit still keeps the printing part for backwards-compatibility
reasons.
@kerneis
Copy link
Contributor Author

kerneis commented Dec 10, 2019

The Python version used to have no output, which is what the document mentions as well:
https://github.com/google/oauth2l/blob/master/python/oauth2l/oauth2l_test.py#L305

However, the switch to the go version in 7c859d8 happened more than a year ago. Although nobody opened a bug since then, Hyrum's law (https://www.hyrumslaw.com/) probably means that someone somewhere relies on it. This change restores the "exit code" behavior while keeping the print statement to ensure maximal backwards compatibility. Forked from discussion in #84.

Copy link
Collaborator

@andyrzhao andyrzhao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks for putting in this fix!

@andyrzhao andyrzhao merged commit 1bd8773 into google:master Dec 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants