feat(stripe): add completion plugin (#12064)

Co-authored-by: Carlo Sala <carlosalag@protonmail.com>
This commit is contained in:
Eric Schultz 2024-02-01 10:16:34 -06:00 committed by GitHub
parent 05bf69c604
commit d6658f9af3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 22 additions and 0 deletions

9
plugins/stripe/README.md Normal file
View file

@ -0,0 +1,9 @@
# Struoe
This plugin provides completion for the [Stripe CLI](https://stripe.com/docs/stripe-cli).
To use it add stripe to the plugins array in your zshrc file.
```bash
plugins=(... stripe)
```

View file

@ -0,0 +1,13 @@
if (( ! $+commands[stripe] )); then
return
fi
# If the completion file doesn't exist yet, we need to autoload it and
# bind it to `stripe`. Otherwise, compinit will have already done that.
if [[ ! -f "$ZSH_CACHE_DIR/completions/_stripe" ]]; then
typeset -g -A _comps
autoload -Uz _stripe
_comps[stripe]=_stripe
fi
stripe completion --shell zsh --write-to-stdout >| "$ZSH_CACHE_DIR/completions/_stripe" &|