smallstep / cli

🧰 A zero trust swiss army knife for working with X509, OAuth, JWT, OATH OTP, etc.
https://smallstep.com/cli
Apache License 2.0
3.56k stars 248 forks source link

Fix fish completion #1222

Closed magnuswatn closed 6 days ago

magnuswatn commented 1 week ago

Fish completion doesn't work, since a nil error is printed after the completion:

❯ ./bin/step completion fish | tail -n 2
complete -c step -n '__fish_seen_subcommand_from revoke' -f -l context -r -d 'The context <name> to apply for the given command.'
<nil>⏎      

❯ ./bin/step completion fish | source
- (line 3899): Expected a string, but found a redirection
<nil>
^
from sourcing file -
source: Error while reading file '<stdin>'                                                                                                                                                                                                                                         

So handle the error instead of printing it.

hslatman commented 6 days ago

Thank you, @magnuswatn 🙂