mirror of
https://github.com/Llewellynvdm/fzf.git
synced 2024-11-25 22:27:41 +00:00
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
|
local cur prev selected
|
||||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
[ "$cur" = '-l' -o "$prev" = '-l' ] && return 1
|
[[ "$cur" =~ ^- || "$prev" =~ ^- ]] && return 1
|
||||||
|
|
||||||
tput sc
|
tput sc
|
||||||
selected=$(grep -v '^\s*\(#\|$\)' /etc/hosts | awk '{print $2}' | sort -u | fzf $FZF_COMPLETION_OPTS -q "$cur")
|
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