completions: bash: simplify awk command used to filter terminfo names

This commit is contained in:
Craig Barnes 2023-01-27 11:47:12 +00:00
parent b81b98d47c
commit 1823fa846a

View file

@ -66,7 +66,7 @@ _foot()
compopt -o dirnames ;;
--term|-t)
command -v toe > /dev/null || return 1
COMPREPLY=( $(compgen -W "$(toe -a | awk '$1 ~ /[+]/ {next}; {print $1}')" -- ${cur}) ) ;;
COMPREPLY=( $(compgen -W "$(toe -a | awk '$1 !~ /[+]/ {print $1}')" -- ${cur}) ) ;;
--font|-f)
command -v fc-list > /dev/null || return 1
COMPREPLY=( $(compgen -W "$(fc-list : family | sed 's/,/\n/g' | uniq | tr -d ' ')" -- ${cur}) ) ;;