Update bash host completion for ssh and telnet commands
This commit is contained in:
parent
5483e41b2a
commit
636c86cf6f
@ -100,7 +100,7 @@ _fzf_host_completion() {
|
||||
local cur prev selected
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
[ "$cur" = '-l' -o "$prev" = '-l' ] && return 1
|
||||
[[ "$cur" =~ ^- || "$prev" =~ ^- ]] && return 1
|
||||
|
||||
tput sc
|
||||
selected=$(grep -v '^\s*\(#\|$\)' /etc/hosts | awk '{print $2}' | sort -u | fzf $FZF_COMPLETION_OPTS -q "$cur")
|
||||
|
Loading…
Reference in New Issue
Block a user