From f86d823dc357624a920fc1374b043c9a96235860 Mon Sep 17 00:00:00 2001 From: BarbUk Date: Fri, 22 Jan 2021 18:41:16 +0400 Subject: [PATCH] Disable SC2207 to keep COMPREPLY simple --- themes/atomic/atomic.theme.bash | 12 +++++------- themes/brainy/brainy.theme.bash | 13 ++++++------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/themes/atomic/atomic.theme.bash b/themes/atomic/atomic.theme.bash index caf488c7..6bde6801 100644 --- a/themes/atomic/atomic.theme.bash +++ b/themes/atomic/atomic.theme.bash @@ -225,17 +225,15 @@ _atomic_completion() { actions="show hide" segments="battery clock exitcode python ruby scm sudo todo" case "${_action}" in - show) - while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "${segments}" -- "${cur}") - return 0 - ;; - hide) - while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "${segments}" -- "${cur}") + show | hide) + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "${segments}" -- "${cur}")) return 0 ;; esac - while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "${actions}" -- "${cur}") + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "${actions}" -- "${cur}")) return 0 } diff --git a/themes/brainy/brainy.theme.bash b/themes/brainy/brainy.theme.bash index 1d0c879b..db8377ba 100644 --- a/themes/brainy/brainy.theme.bash +++ b/themes/brainy/brainy.theme.bash @@ -207,16 +207,15 @@ _brainy_completion() { actions="show hide" segments="battery clock exitcode python ruby scm sudo todo" case "${_action}" in - show) - while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "${segments}" -- "${cur}") - return 0 - ;; - hide) - while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "${segments}" -- "${cur}") + show | hide) + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "${segments}" -- "${cur}")) return 0 ;; esac - while IFS='' read -r line; do COMPREPLY+=("$line"); done < <(compgen -W "${actions}" -- "${cur}") + + # shellcheck disable=SC2207 + COMPREPLY=($(compgen -W "${actions}" -- "${cur}")) return 0 }