Open JamesKyburz opened 8 months ago
Hi @JamesKyburz thanks for the feature request! I'll bring this up with the team.
As an alternative, you could try using Code Whisperer CLI and it gives smart auto-completion for SAM CLI commands.
As an optimisation to prevent shells having to generate completions each startup, I recommend a change to the proposal for bash
:
#! /bin/bash
sam completion > ${XDG_DATA_HOME:-~/.local/share}/bash-completion/completions/sam
This is based off the bash-completion documentation:
Q. Where should I install my own local completions?
A. Put them in the completions subdir of $BASH_COMPLETION_USER_DIR (defaults to $XDG_DATA_HOME/bash-completion or ~/.local/share/bash-completion if $XDG_DATA_HOME is not set) to have them loaded automatically on demand when the respective command is being completed. See also the next question's answer for considerations for these files' names, they apply here as well. Alternatively, you can write them directly in ~/.bash_completion which is loaded eagerly by our main script.
Someone more familiar with zsh
will need to provide guidance their completion system.
Support shell completion?
click has support for completion documented here
Is there any reason we shouldn't support it?
Proposal
Was thinking something along the lines of adding the allowing the following in ~/.zshrc, or ~/.bashrc
Where we would detect if the completion is for
zsh
orbash
, and error if the shell is unsupported.