source: transgenic/trunk/fuentes/install/etc/bash_completion.d/tg @ 389

Last change on this file since 389 was 389, checked in by mabarracus, 4 years ago

Copy trusty code

File size: 990 bytes
Line 
1have tg &&
2_tg()             
3{
4    local cur prev opts base
5    COMPREPLY=()
6    cur="${COMP_WORDS[COMP_CWORD]}"
7    prev="${COMP_WORDS[COMP_CWORD-1]}"
8
9    #
10    #  The basic options we'll complete.
11    #
12    opts="expand-all sow-all list clean test quick-list version expand sow expand-packages depends tree add del rm test readlink erase plist mv include uninclude edit vi vim pager less more nano exec mkdir rmdir pgrep pdel prm padd -c -s -l -y"
13
14
15    #
16    #  Complete the arguments to some of the basic commands.
17    #
18    case "${prev}" in
19        sow|tree|add|del|rm|test|readlink|erase|plist|mv|include|uninclude|edit|vi|vim|pager|less|more|nano|exec|mkdir|rmdir|pgrep|pdel|prm|padd|scite)
20            local running=$( ls desc/seeds-trusty/lliurex/ )
21            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
22            return 0
23            ;;
24        *)
25        ;;
26    esac
27
28   COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
29   return 0
30}
31[ "$have" ] && complete -F _tg tg
Note: See TracBrowser for help on using the repository browser.