feat(stripe): add completion plugin (#12064)
Co-authored-by: Carlo Sala <carlosalag@protonmail.com>master
parent
05bf69c604
commit
d6658f9af3
2 changed files with 22 additions and 0 deletions
@ -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) |
||||||
|
``` |
||||||
@ -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" &| |
||||||
Loading…
Reference in new issue