Document exit codes for `gh release`
Describe the feature or problem you’d like to solve
Currently, if gh release cannot find the release you're looking for, it exits with exit code 1. If it's found then you get exit code 0. This is not documented behavior though, so it's iffy to rely on as it could change.
Proposed solution
Update the documentation for gh release to include the exit code contract.
I'm happy to open a PR documenting the exit codes for gh release - but I'm not quite sure where the source for the manual is? It doesn't seem to be in this repo.
Hi, thanks for pointing this out. An object not being found is typically an error across gh commands, and it's a convention for command-line programs to exit with 1 (or another non-zero status) on errors. So, the exit status 0 vs 1 distinction should be implied, but I agree that it could also be pointed out in the documentation.
The documentation for the gh release command is generated from the source code. See the cobra.Command initialization in pkg/cmd/release/view. You're welcome to submit PRs there, but I wonder whether we should just document global return code conventions in a generic place, not per each gh command (since almost every command would have to repeat the same line of documentation).
https://github.com/cli/cli/blob/538be1e39800db62a9dd98fa07dcf83b7c40dece/cmd/gh/main.go#L41-L44
I figured this was a global thing, indeed it's a convention that many command line tools use (and that's how I found it originally). I'd love to document it at some global level - where would I best do that?
@inktomi I think adding another topic to the HelpTopics here is the best place to document it.