From 34d68797f7f25b405aa6e05dbea09581ffca57fd Mon Sep 17 00:00:00 2001 From: rsteube Date: Fri, 21 Jun 2019 20:05:29 +0200 Subject: [PATCH] using shellcheck example --- bash_completions.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bash_completions.go b/bash_completions.go index cb3c59d71b..03ddda27a3 100644 --- a/bash_completions.go +++ b/bash_completions.go @@ -72,7 +72,7 @@ __%[1]s_handle_reply() else allflags=("${flags[*]} ${two_word_flags[*]}") fi - while read -r -s -d " " c ; do + while IFS='' read -r c; do COMPREPLY+=("$c") done < <(compgen -W "${allflags[*]}" -- "$cur") if [[ $(type -t compopt) = "builtin" ]]; then @@ -124,12 +124,12 @@ __%[1]s_handle_reply() if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then completions+=("${must_have_one_flag[@]}") fi - while read -r -s -d " " c ; do + while IFS='' read -r c; do COMPREPLY+=("$c") done < <(compgen -W "${completions[*]}" -- "$cur") if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then - while read -r -s -d " " c ; do + while IFS='' read -r c; do COMPREPLY+=("$c") done < <(compgen -W "${noun_aliases[*]}" -- "$cur") fi