Skip to content
Myr

bash: fix shellcheck errors (#889)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

https://github.com/koalaman/shellcheck/wiki/SC2207 https://github.com/koalaman/shellcheck/wiki/SC2164

authored by rsteube · committed by Joshua Harshman · parent f2b07da · Browse files · 1 file+10 added−4 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • https: //github.com/koalaman/shellcheck/wiki/SC2207
  • https: //github.com/koalaman/shellcheck/wiki/SC2164

Diff stats

1 file+10 added−4 removed

  • other:+10 added−4 removed

1 file+10 added−4 removed

modified:bash_completions.go+10 added-4 removed
70 unmodified lines
71 allflags=("${must_have_one_flag[@]}")72 else73 allflags=("${flags[*]} ${two_word_flags[*]}")74 fi75 COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )75 while IFS='' read -r c; do76 COMPREPLY+=("$c")77 done < <(compgen -W "${allflags[*]}" -- "$cur")78 if [[ $(type -t compopt) = "builtin" ]]; then79 [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace80 fi81
41 unmodified lines
123 fi124 if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then125 completions+=("${must_have_one_flag[@]}")126 fi125 COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )127 while IFS='' read -r c; do128 COMPREPLY+=("$c")129 done < <(compgen -W "${completions[*]}" -- "$cur")130131 if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then128 COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") )132 while IFS='' read -r c; do133 COMPREPLY+=("$c")134 done < <(compgen -W "${noun_aliases[*]}" -- "$cur")135 fi136137 if [[ ${#COMPREPLY[@]} -eq 0 ]]; then138 if declare -F __%[1]s_custom_func >/dev/null; then
26 unmodified lines
165166__%[1]s_handle_subdirs_in_dir_flag()167{168 local dir="$1"163 pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1169 pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 || return170}171172__%[1]s_handle_flag()173{
380 unmodified lines