From 39333ad0cbef211ec1d6ee2b0fec5508bb29ffaf Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 30 May 2018 20:31:22 +1000 Subject: [PATCH] completion: Finish args --- completions/neofetch-completion.bash | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/completions/neofetch-completion.bash b/completions/neofetch-completion.bash index f3b1fcf6..6ced0dad 100644 --- a/completions/neofetch-completion.bash +++ b/completions/neofetch-completion.bash @@ -4,19 +4,19 @@ shopt -s nullglob _neofetch_completions() { - local flags cur prev usage - - usage="$(neofetch --help)" + local flags cur prev # User input. cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" # Generate a list of flags. - IFS=$'\n' read -d "" -ra flags < <(awk '/^ --/{print $1}' <<< "$usage") + IFS=$'\n' read -d "" -ra flags \ + < <(neofetch --help | awk '/^ --/{print $1}') # Complete partial matches. - IFS=$'\n' read -d "" -ra COMPREPLY < <(compgen -W "${flags[*]}" -- "$cur") + IFS=$'\n' read -d "" -ra COMPREPLY \ + < <(compgen -W "${flags[*]}" -- "$cur") case "$prev" in "--disable")