source: frontend/node_modules/coa/lib/completion.sh

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 1.3 KB
Line 
1#!/usr/bin/env bash
2###-begin-{{cmd}}-completion-###
3#
4# {{cmd}} command completion script
5#
6# Installation: {{cmd}} completion >> ~/.bashrc (or ~/.zshrc)
7# Or, maybe: {{cmd}} completion > /usr/local/etc/bash_completion.d/{{cmd}}
8#
9
10COMP_WORDBREAKS=${COMP_WORDBREAKS/=/}
11COMP_WORDBREAKS=${COMP_WORDBREAKS/@/}
12export COMP_WORDBREAKS
13
14if complete &>/dev/null; then
15 _{{cmd}}_completion () {
16 local si="$IFS"
17 IFS=$'\n' COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
18 COMP_LINE="$COMP_LINE" \
19 COMP_POINT="$COMP_POINT" \
20 {{cmd}} completion -- "${COMP_WORDS[@]}" \
21 2>/dev/null)) || return $?
22 IFS="$si"
23 }
24 complete -F _{{cmd}}_completion {{cmd}}
25elif compctl &>/dev/null; then
26 _{{cmd}}_completion () {
27 local cword line point words si
28 read -Ac words
29 read -cn cword
30 let cword-=1
31 read -l line
32 read -ln point
33 si="$IFS"
34 IFS=$'\n' reply=($(COMP_CWORD="$cword" \
35 COMP_LINE="$line" \
36 COMP_POINT="$point" \
37 {{cmd}} completion -- "${words[@]}" \
38 2>/dev/null)) || return $?
39 IFS="$si"
40 }
41 compctl -K _{{cmd}}_completion {{cmd}}
42fi
43###-end-{{cmd}}-completion-###
Note: See TracBrowser for help on using the repository browser.