qemu: Use _parse_help, add basic test case.

master
Ville Skyttä 2011-05-15 15:23:05 +03:00
parent 1db66124e9
commit 84f9f78494
3 changed files with 23 additions and 14 deletions

View File

@ -102,20 +102,8 @@ _qemu()
if [[ "$cur" == -* ]]; then
COMPREPLY=( $( compgen -W '-M -fda -fdb -hda -hdb -hdc -hdd \
-cdrom -boot -snapshot -no-fd-bootchk -m -smp -nographic -vnc \
-k -audio-help -soundhw -localtime -full-screen -pidfile \
-daemonize -win2k-hack -option-rom -usb -usbdevice -net -tftp \
-smb -redir -kernel -append -initrd -serial -parallel -monitor \
-s -p -S -d -hdachs -L -std-vga -no-acpi -no-reboot -loadvm \
-semihosting -cpu -bt -vga -drive -startdate -name -curses \
-no-frame -no-quit -bootp -echr -no-shutdown -icount -g \
-prom-env -help -version -numa -mtdblock -sd -pflash \
-device -uuid -alt-grab -sdl -portrait -rtc-td-hack -no-hpet \
-balloon -acpitable -smbios -singlestep -gdb -hdachs -bios \
-kernel-kqemu -enable-kqemu -enable-kvm -clock -watchdog \
-watchdog-action -virtioconsole -show-cursor -tb-size -incoming \
-chroot -runas' -- "$cur" ) )
COMPREPLY=( $( compgen -W '$( _parse_help "$1" -help ) -fd{a,b}
-hd{a..d}' -- "$cur" ) )
else
_filedir
fi

1
test/completion/qemu.exp Normal file
View File

@ -0,0 +1 @@
assert_source_completions qemu

View File

@ -0,0 +1,20 @@
proc setup {} {
save_env
}
proc teardown {} {
assert_env_unmodified
}
setup
assert_complete_any "qemu "
sync_after_int
teardown