mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
Move _cdk completion
This commit is contained in:
parent
d129155380
commit
9627cc86c6
3 changed files with 18 additions and 20 deletions
|
|
@ -1,11 +1,6 @@
|
||||||
# AWS CDK Plugin
|
# AWS CDK Plugin
|
||||||
|
|
||||||
This plugin provides aliases and autocompletion for the
|
This plugin provides aliases and autocompletion for the [AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) CLI.
|
||||||
[AWS Cloud Development Kit (CDK)](https://aws.amazon.com/cdk/) CLI.
|
|
||||||
|
|
||||||
## Requirements
|
|
||||||
|
|
||||||
- [AWS CDK CLI](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) installed (`npm install -g aws-cdk`)
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
|
@ -15,6 +10,10 @@ Add `cdk` to the plugins array in your `.zshrc`:
|
||||||
plugins=(... cdk)
|
plugins=(... cdk)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
|
||||||
|
- [AWS CDK CLI](https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html) installed (`npm install -g aws-cdk`)
|
||||||
|
|
||||||
## Aliases
|
## Aliases
|
||||||
|
|
||||||
| Alias | Command | Description |
|
| Alias | Command | Description |
|
||||||
|
|
@ -30,4 +29,4 @@ plugins=(... cdk)
|
||||||
| `cdkwatch` | `cdk watch` | Watch for changes and auto-deploy |
|
| `cdkwatch` | `cdk watch` | Watch for changes and auto-deploy |
|
||||||
| `cdkctx` | `cdk context` | Manage cached context values |
|
| `cdkctx` | `cdk context` | Manage cached context values |
|
||||||
| `cdkack` | `cdk acknowledge` | Acknowledge a notice |
|
| `cdkack` | `cdk acknowledge` | Acknowledge a notice |
|
||||||
| `cdkver` | `cdk --version` | Print CDK version |
|
| `cdkver` | `cdk --version` | Print CDK version |
|
||||||
|
|
|
||||||
12
plugins/cdk/_cdk
Normal file
12
plugins/cdk/_cdk
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
#compdef cdk
|
||||||
|
|
||||||
|
# Originally found and adapted from: https://github.com/aws/aws-cdk/discussions/24380#discussioncomment-5158176
|
||||||
|
|
||||||
|
local -a reply
|
||||||
|
local IFS
|
||||||
|
IFS=$'\n' reply=($(COMP_CWORD="$((CURRENT-1))" \
|
||||||
|
COMP_LINE="$BUFFER" \
|
||||||
|
COMP_POINT="$CURSOR" \
|
||||||
|
cdk --get-yargs-completions "${words[@]}"))
|
||||||
|
|
||||||
|
_describe 'values' reply
|
||||||
|
|
@ -1,6 +1,3 @@
|
||||||
# AWS CDK plugin for Oh My Zsh
|
|
||||||
# Provides aliases and autocompletion for the AWS Cloud Development Kit (CDK) CLI
|
|
||||||
|
|
||||||
# Aliases
|
# Aliases
|
||||||
alias cdkl='cdk list'
|
alias cdkl='cdk list'
|
||||||
alias cdksynth='cdk synth'
|
alias cdksynth='cdk synth'
|
||||||
|
|
@ -14,13 +11,3 @@ alias cdkwatch='cdk watch'
|
||||||
alias cdkctx='cdk context'
|
alias cdkctx='cdk context'
|
||||||
alias cdkack='cdk acknowledge'
|
alias cdkack='cdk acknowledge'
|
||||||
alias cdkver='cdk --version'
|
alias cdkver='cdk --version'
|
||||||
|
|
||||||
# Autocompletion
|
|
||||||
if command -v cdk &>/dev/null; then
|
|
||||||
_cdk_completion() {
|
|
||||||
local -a completions
|
|
||||||
completions=($(cdk completion 2>/dev/null))
|
|
||||||
compadd -a completions
|
|
||||||
}
|
|
||||||
compdef _cdk_completion cdk
|
|
||||||
fi
|
|
||||||
Loading…
Reference in a new issue