diff --git a/lib/completely/templates/template.erb b/lib/completely/templates/template.erb index dcf03b2..d93b29d 100644 --- a/lib/completely/templates/template.erb +++ b/lib/completely/templates/template.erb @@ -19,7 +19,7 @@ % patterns.each do |pattern| % next if pattern.empty? <%= pattern.case_string %>) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen <%= pattern.compgen %> -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen <%= pattern.compgen %> -- "$cur" ) ;; % end diff --git a/spec/approvals/cli/generated-script b/spec/approvals/cli/generated-script index 93f465e..2b281c1 100644 --- a/spec/approvals/cli/generated-script +++ b/spec/approvals/cli/generated-script @@ -10,19 +10,19 @@ _mygit_completions() { case "$compline" in 'status'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" ) ;; 'commit'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" ) ;; 'init'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" ) ;; *) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" ) ;; esac diff --git a/spec/approvals/cli/generated-script-alt b/spec/approvals/cli/generated-script-alt index 34487c4..c801c71 100644 --- a/spec/approvals/cli/generated-script-alt +++ b/spec/approvals/cli/generated-script-alt @@ -10,19 +10,19 @@ _mycomps() { case "$compline" in 'status'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" ) ;; 'commit'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" ) ;; 'init'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" ) ;; *) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" ) ;; esac diff --git a/spec/approvals/cli/generated-wrapped-script b/spec/approvals/cli/generated-wrapped-script index 969ffc8..9e0206b 100644 --- a/spec/approvals/cli/generated-wrapped-script +++ b/spec/approvals/cli/generated-wrapped-script @@ -11,19 +11,19 @@ give_comps() { echo $'' echo $' case "$compline" in' echo $' \'status\'*)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" )' echo $' ;;' echo $'' echo $' \'commit\'*)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" )' echo $' ;;' echo $'' echo $' \'init\'*)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" )' echo $' ;;' echo $'' echo $' *)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" )' echo $' ;;' echo $'' echo $' esac' diff --git a/spec/approvals/cli/test/completely-tester.sh b/spec/approvals/cli/test/completely-tester.sh index 42b7bde..8208730 100644 --- a/spec/approvals/cli/test/completely-tester.sh +++ b/spec/approvals/cli/test/completely-tester.sh @@ -18,19 +18,19 @@ _mygit_completions() { case "$compline" in 'status'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --verbose --branch $(git branch 2> /dev/null)" -- "$cur" ) ;; 'commit'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A file -W "--help --message --all -a --quiet -q" -- "$cur" ) ;; 'init'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--bare" -- "$cur" ) ;; *) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version status init commit" -- "$cur" ) ;; esac diff --git a/spec/approvals/completions/function b/spec/approvals/completions/function index f683e42..fd104a3 100644 --- a/spec/approvals/completions/function +++ b/spec/approvals/completions/function @@ -11,15 +11,15 @@ send_completions() { echo $'' echo $' case "$compline" in' echo $' \'generate\'*)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--help --force" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--help --force" -- "$cur" )' echo $' ;;' echo $'' echo $' \'init\'*)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help" -- "$cur" )' echo $' ;;' echo $'' echo $' *)' - echo $' while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version init generate" -- "$cur" )' + echo $' while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version init generate" -- "$cur" )' echo $' ;;' echo $'' echo $' esac' diff --git a/spec/approvals/completions/script b/spec/approvals/completions/script index c6e0c58..df8761a 100644 --- a/spec/approvals/completions/script +++ b/spec/approvals/completions/script @@ -10,15 +10,15 @@ _completely_completions() { case "$compline" in 'generate'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--help --force" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--help --force" -- "$cur" ) ;; 'init'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help" -- "$cur" ) ;; *) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version init generate" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version init generate" -- "$cur" ) ;; esac diff --git a/spec/approvals/completions/script-only-spaces b/spec/approvals/completions/script-only-spaces index e4d3402..ec5bc59 100644 --- a/spec/approvals/completions/script-only-spaces +++ b/spec/approvals/completions/script-only-spaces @@ -10,11 +10,11 @@ _completely_completions() { case "$compline" in 'generate'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--help --force" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -A directory -W "--help --force" -- "$cur" ) ;; 'init'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help" -- "$cur" ) ;; esac diff --git a/spec/fixtures/tester/default.bash b/spec/fixtures/tester/default.bash index 8a0d7a3..8c91d19 100644 --- a/spec/fixtures/tester/default.bash +++ b/spec/fixtures/tester/default.bash @@ -10,19 +10,19 @@ _cli_completions() { case "$compline" in 'command childcommand'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--quiet --verbose -q -v" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--quiet --verbose -q -v" -- "$cur" ) ;; 'command subcommand'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--force --quiet" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--force --quiet" -- "$cur" ) ;; 'command'*) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "subcommand childcommand" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "subcommand childcommand" -- "$cur" ) ;; *) - while read; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version command conquer" -- "$cur" ) + while read -r; do COMPREPLY+=( "$REPLY" ); done < <( compgen -W "--help --version command conquer" -- "$cur" ) ;; esac