From fb5d20a9c43e1605abc51ef8810495dbe62c9951 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Wed, 30 May 2018 20:40:21 +1000 Subject: [PATCH] completion: Finish args --- completions/neofetch-completion.bash | 8 ++------ neofetch | 2 +- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/completions/neofetch-completion.bash b/completions/neofetch-completion.bash index 6ced0dad..6cac09e7 100644 --- a/completions/neofetch-completion.bash +++ b/completions/neofetch-completion.bash @@ -4,19 +4,15 @@ shopt -s nullglob _neofetch_completions() { - local flags cur prev + local 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 \ - < <(neofetch --help | awk '/^ --/{print $1}') - # Complete partial matches. IFS=$'\n' read -d "" -ra COMPREPLY \ - < <(compgen -W "${flags[*]}" -- "$cur") + < <(compgen -W "$(neofetch -h | awk '/^ --/{printf $1" "}')" -- "$cur") case "$prev" in "--disable") diff --git a/neofetch b/neofetch index 5742dcc8..de14d01d 100755 --- a/neofetch +++ b/neofetch @@ -4705,7 +4705,7 @@ get_args() { "-v") verbose="on" ;; "--print_config") printf "%s\\n" "$config"; exit ;; "-vv") set -x; verbose="on" ;; - "--help") usage ;; + "-h"|"--help") usage ;; "--version") printf "%s\\n" "Neofetch $version" exit 1