Closed kerneis closed 4 years ago
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 https://github.com/google/oauth2l/commit/7c859d8b1e382dd398753bfb191e26f45f282d5e 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 https://github.com/google/oauth2l/pull/84.
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.