When ran directly in the terminal, the command now errors out with:
$ gh completion
error: the value for `--shell` is required
see `gh completion --help` for more information
This is to avoid the previously default bash code output confusing the
user if they ran the command out of curiousity.
A backwards compatibility layer is present here: if stdout is not a
terminal, then output bash code like before. This is to support users
who have already added a line like this to their bash profile:
eval "$(gh completion)"
|
||
|---|---|---|
| .. | ||
| completion.go | ||
| completion_test.go | ||
| issue.go | ||
| issue_test.go | ||
| pr.go | ||
| pr_checkout.go | ||
| pr_checkout_test.go | ||
| pr_create.go | ||
| pr_create_test.go | ||
| pr_test.go | ||
| repo.go | ||
| repo_test.go | ||
| root.go | ||
| root_test.go | ||
| testing.go | ||
| title_body_survey.go | ||