Sha256: 12e035923970aff3bea3214496022ced32a3bd0265ffdd8b771cc46d7229c3f7

Contents?: true

Size: 1.26 KB

Versions: 34

Compression:

Stored size: 1.26 KB

Contents

#!/usr/bin/env bash
###-begin-{{cmd}}-completion-###
#
# {{cmd}} command completion script
#
# Installation: {{cmd}} completion >> ~/.bashrc  (or ~/.zshrc)
# Or, maybe: {{cmd}} completion > /usr/local/etc/bash_completion.d/{{cmd}}
#

COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
export COMP_WORDBREAKS

if complete &>/dev/null; then
  _{{cmd}}_completion () {
    local si="$IFS"
    IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
                           COMP_LINE="$COMP_LINE" \
                           COMP_POINT="$COMP_POINT" \
                           {{cmd}} completion -- "${COMP_WORDS[@]}" \
                           2>/dev/null)) || return $?
    IFS="$si"
  }
  complete -F _{{cmd}}_completion {{cmd}}
elif compctl &>/dev/null; then
  _{{cmd}}_completion () {
    local cword line point words si
    read -Ac words
    read -cn cword
    let cword-=1
    read -l line
    read -ln point
    si="$IFS"
    IFS=$'\n' reply=($(COMP_CWORD="$cword" \
                       COMP_LINE="$line" \
                       COMP_POINT="$point" \
                       {{cmd}} completion -- "${words[@]}" \
                       2>/dev/null)) || return $?
    IFS="$si"
  }
  compctl -K _{{cmd}}_completion {{cmd}}
fi
###-end-{{cmd}}-completion-###

Version data entries

34 entries across 31 versions & 11 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/coa/lib/completion.sh
disco_app-0.18.0 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.18.2 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.16.1 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.15.2 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.18.4 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.18.1 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.14.0 test/dummy/node_modules/coa/lib/completion.sh
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/coa/lib/completion.sh
tang-0.2.1 spec/tang_app/node_modules/coa/lib/completion.sh
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/coa/lib/completion.sh
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/coa/lib/completion.sh
ruby2js-4.0.4 lib/tasks/testrails/node_modules/coa/lib/completion.sh
ruby2js-4.0.3 lib/tasks/testrails/node_modules/coa/lib/completion.sh
tang-0.2.0 spec/tang_app/node_modules/coa/lib/completion.sh
tang-0.1.0 spec/tang_app/node_modules/coa/lib/completion.sh
tang-0.0.9 spec/tang_app/node_modules/coa/lib/completion.sh
enju_library-0.3.8 spec/dummy/node_modules/coa/lib/completion.sh
jester-data-8.0.0 node_modules/coa/lib/completion.sh