diff options
author | Nate Ober <nate.ober@schools.utah.gov> | 2013-01-23 14:46:00 -0700 |
---|---|---|
committer | Mathias Bynens <mathias@qiwi.be> | 2013-03-10 10:19:48 +0100 |
commit | 969c95bfe9ebd682bcafa84518f916879c48b8d0 (patch) | |
tree | d2d5ff6525f92f5966cb40c0cf08c95ca98c1e0e | |
parent | 2e08075960fb33b95aa04d67847c3382dadbe016 (diff) | |
download | dotfiles-969c95bfe9ebd682bcafa84518f916879c48b8d0.tar.gz dotfiles-969c95bfe9ebd682bcafa84518f916879c48b8d0.tar.bz2 dotfiles-969c95bfe9ebd682bcafa84518f916879c48b8d0.zip |
.bash_profile: Support hostname aliases defined in `~/.ssh/config`
`~/.ssh/config` allows for the usage of hostname aliases, formatted as follows:
Host first_alias second_alias third_alias
HostName foo.example.com
This change makes sure these aliases are parsed out individually and added to the autocomplete list.
Ref. #178.
-rw-r--r-- | .bash_profile | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/.bash_profile b/.bash_profile index 7eacfc8..cede3d7 100644 --- a/.bash_profile +++ b/.bash_profile @@ -26,7 +26,7 @@ for option in autocd globstar; do done # Add tab completion for SSH hostnames based on ~/.ssh/config, ignoring wildcards -[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2)" scp sftp ssh +[ -e "$HOME/.ssh/config" ] && complete -o "default" -o "nospace" -W "$(grep "^Host" ~/.ssh/config | grep -v "[?*]" | cut -d " " -f2 | tr ' ' '\n')" scp sftp ssh # Add tab completion for `defaults read|write NSGlobalDomain` # You could just use `-g` instead, but I like being explicit |