summaryrefslogtreecommitdiffstats
path: root/completions/qemu
blob: 83829812765df180d8516ec980b87ff42bb142cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# bash completion for qemu                                 -*- shell-script -*-

_qemu()
{
    local cur prev words cword
    _init_completion || return

    case $prev in
        -fd[ab] | -hd[abcd] | -cdrom | -option-rom | -kernel | -initrd | -bootp | -pidfile | \
            -loadvm | -mtdblock | -sd | -pflash | -bios)
            _filedir
            return
            ;;
        -tftp | -smb | -L | -chroot)
            _filedir -d
            return
            ;;
        -boot)
            COMPREPLY=($(compgen -W 'a c d n' -- "$cur"))
            return
            ;;
        -k)
            COMPREPLY=($(compgen -W 'ar de-ch es fo fr-ca hu ja mk no pt-br
                sv da en-gb et fr fr-ch is lt nl pl ru th de en-us fi fr-be hr
                it lv nl-be pt sl tr' -- "$cur"))
            return
            ;;
        -soundhw)
            COMPREPLY=($(compgen -W "$($1 -soundhw help | awk \
                '/^[[:lower:]]/ {print $1}') all" -- "$cur"))
            return
            ;;
        -machine | -M)
            COMPREPLY=($(compgen -W "$($1 $prev help | awk \
                '/^[[:lower:]]/ {print $1}')" -- "$cur"))
            return
            ;;
        -cpu)
            COMPREPLY=($(compgen -W "$($1 -cpu help | awk '{print $2}')" \
                -- "$cur"))
            return
            ;;
        -usbdevice)
            COMPREPLY=($(compgen -W 'mouse tablet disk: host: serial: braille
                net' -- "$cur"))
            return
            ;;
        -net)
            COMPREPLY=($(compgen -W 'nic user tap socket vde none dump' \
                -- "$cur"))
            return
            ;;
        -serial | -parallel | -monitor)
            COMPREPLY=($(compgen -W 'vc pty none null /dev/ file: stdio pipe:
                COM udp: tcp: telnet: unix: mon: braille' -- "$cur"))
            return
            ;;
        -redir)
            COMPREPLY=($(compgen -S":" -W 'tcp udp' -- "$cur"))
            return
            ;;
        -bt)
            COMPREPLY=($(compgen -W 'hci vhci device' -- "$cur"))
            return
            ;;
        -vga)
            COMPREPLY=($(compgen -W 'cirrus std vmware xenfb none' -- "$cur"))
            return
            ;;
        -drive)
            COMPREPLY=($(compgen -S"=" -W 'file if bus unit index media cyls
                snapshot cache format serial addr' -- "$cur"))
            return
            ;;
        -balloon)
            COMPREPLY=($(compgen -W 'none virtio' -- "$cur"))
            return
            ;;
        -smbios)
            COMPREPLY=($(compgen -W 'file type' -- "$cur"))
            return
            ;;
        -watchdog)
            COMPREPLY=($(compgen -W "$($1 -watchdog help 2>&1 |
                awk '{print $1}')" -- "$cur"))
            return
            ;;
        -watchdog-action)
            COMPREPLY=($(compgen -W 'reset shutdown poweroff pause debug
                none' -- "$cur"))
            return
            ;;
        -runas)
            _allowed_users
            return
            ;;
    esac

    if [[ $cur == -* ]]; then
        COMPREPLY=($(compgen -W '$(_parse_help "$1" -help) -fd{a,b}
            -hd{a..d}' -- "$cur"))
    else
        _filedir
    fi
} &&
    complete -F _qemu qemu qemu-kvm qemu-system-i386 qemu-system-x86_64

# ex: filetype=sh