Commit graph

9 commits

Author SHA1 Message Date
Mislav Marohnić
2915abc2ba Improve user-friendliness of completion command
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)"
2020-04-07 16:58:50 +02:00
Mislav Marohnić
fa595596de Improve completion docs 2020-03-05 09:34:05 +01:00
Mislav Marohnić
aa07c5366e Add support for PowerShell completion 2020-03-05 09:33:49 +01:00
Mislav Marohnić
6424e8c92a Make sure to handle errors when generating completions 2020-02-19 15:39:33 +01:00
Mislav Marohnić
5c4d118f2c Extract vendored fish completion for Cobra to a temporary package 2020-01-29 12:39:02 +01:00
Mislav Marohnić
09f3d176ff Fix test for unsupported shell type 2020-01-29 12:27:02 +01:00
Mislav Marohnić
2abee0905b Add fish completion support via Cobra contributor
Co-authored-by: Tim Reddehase <tim.reddehase@xing.com>
2020-01-28 22:04:40 +01:00
Mislav Marohnić
4f03370aa5 Add tests 2019-10-31 23:43:50 +01:00
Mislav Marohnić
d9ef40c873 Add completion script 2019-10-31 11:41:24 +01:00