mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-07-30 21:57:44 +00:00
Add custom completions for aws-cli (#1073)
Aws-cli ships with a dedicated completion binary that only needs to be passed current commandline to work. Space is appended to returned results so that completing subcommands can be done simply by pressing tab multiple times
This commit is contained in:
parent
861a99779d
commit
0bdf55f71f
2 changed files with 22 additions and 0 deletions
13
custom-completions/aws/aws-completions.nu
Normal file
13
custom-completions/aws/aws-completions.nu
Normal file
|
@ -0,0 +1,13 @@
|
|||
def complete-commands [
|
||||
context: string
|
||||
] {
|
||||
with-env {COMP_LINE: $context} {
|
||||
aws_completer
|
||||
| lines
|
||||
| each {|x| $"($x) "}
|
||||
}
|
||||
}
|
||||
|
||||
export extern "aws" [
|
||||
...command: string@complete-commands
|
||||
]
|
9
custom-completions/aws/readme.md
Normal file
9
custom-completions/aws/readme.md
Normal file
|
@ -0,0 +1,9 @@
|
|||
# Amazon Web Services CLI completions
|
||||
|
||||
A Nushell extern definition and completers for [Amazon Web Services CLI `aws`](https://aws.amazon.com/cli/).
|
||||
|
||||
This module utilizes the `aws_completer` binary that ships with `aws` to provide completions
|
||||
|
||||
## How to use
|
||||
|
||||
Add `source path/to/aws-completions.nu` to your `config.nu` (`$nu.config-path`).
|
Loading…
Add table
Add a link
Reference in a new issue