1
0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-22 12:46:13 +08:00

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" &|