source: lliurex-maker/trunk/fuentes/new/etc/bash_completion.d/lliurex-maker

Last change on this file was 1199, checked in by kbut, 4 years ago

added support to extra mirrors

File size: 920 bytes
Line 
1have lliurex-maker &&
2_lliurex_maker()             
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="build clean -a --arch= -m --mirror= -i --interactive -p --ppa -e --extramirror"
13
14
15    #
16    #  Complete the arguments to some of the basic commands.
17    #
18    case "${prev}" in
19        build)
20            local running=$( ls /usr/share/lliurex-maker/configuration/ | grep -v "common" | tr "\n" " ")
21            COMPREPLY=( $(compgen -W "${running}" -- ${cur}) )
22            return 0
23            ;;
24        -a)
25                local archs="i386 amd64"
26                COMPREPLY=( $(compgen -W "${archs}" -- ${cur}) )
27                return 0
28        ;;
29        *)
30        ;;
31    esac
32
33   COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
34   return 0
35}
36[ "$have" ] && complete -F _lliurex_maker lliurex-maker
Note: See TracBrowser for help on using the repository browser.