-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support aliases in completion scripts #827
Comments
The simple fix for this is to create multiple aliases--one for each profile. Assuming you have two profile, alias awsv-work ='env -u AWS_VAULT -u AWS_REGION -u AWS_DEFAULT_REGION aws-vault exec work'
alias awsv-home='env -u AWS_VAULT -u AWS_REGION -u AWS_DEFAULT_REGION aws-vault exec home' Your shell should then auto-complete the alias names by default. The alternative is to write your own shell completion script. It's doable, but not exactly trivial. By aliasing parts of the command, you're essentially changing the completion options so the script included with |
@irgeek I've got too many profiles to do the alias trick :( Thanks for your input, it works as you said:
I'm happy enough with this setup, perhaps it's worth tagging this issue an an enhancement though as adjusting the completion script to support aliases would be a great enhancement, e.g.:
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
aws-vault exec $profile
is quite long and covers 90% of my usage of aws-vault once setup is complete, furthermore I need to unset variables to change the aws account I am assumed against making the process even more verbose. As a result of all this I like alias my primaryaws-vault
command to something a bit smalleralias awsv='unset AWS_VAULT AWS_REGION AWS_DEFAULT_REGION; aws-vault exec'
. Using my alias breaks the completion script however.Using the normal
aws-vault
command tabbing will bring up the configured profiles, if I use my alias tabbing just brings up als
of one of my completion script directories.What do I need to add to my
.bashrc
to allow my alias to work withaws-vault
? Perhaps this information should be included in the shell-completion section as I think aliasing the command will be a fairly common configuration.https://kubernetes.io/docs/tasks/tools/included/optional-kubectl-configs-bash-linux/#enable-kubectl-autocompletion Kubernetes provides some information on how to get completion scripts to work with an alias, it would be great if
aws-vault
provided the same sort of documentation as this for those that like to use aliases.The text was updated successfully, but these errors were encountered: