* [patch] signify and vmctl completers
@ 2018-04-07 1:08 Matthew Martin
0 siblings, 0 replies; only message in thread
From: Matthew Martin @ 2018-04-07 1:08 UTC (permalink / raw)
To: zsh-workers
It seems to be the time to raid your tree for unset completer changes,
so here are two for signify and vmctl. Thanks to Oliver for helping with
_vmctl.
- Matthew Martin
diff --git a/Completion/BSD/Command/_signify b/Completion/BSD/Command/_signify
new file mode 100644
index 000000000..26571aa2a
--- /dev/null
+++ b/Completion/BSD/Command/_signify
@@ -0,0 +1,31 @@
+#compdef signify
+
+_arguments -s -S -A "-*" : \
+ - checksum \
+ '-C[verify a signed checksum list and the checksum for each file]' \
+ '-p[public key]:public key:_files' \
+ '-q[quiet mode]' \
+ '-x[signature file]:signature file:_files' \
+ '*:file:_files' \
+ - generate \
+ '-G[generate a new key pair]' \
+ '-c[specify comment]:comment:' \
+ '-n[do not ask for passphrase]' \
+ '-p[public key]:public key:_files' \
+ '-s[secret key]:secret key:_files' \
+ - sign \
+ '-S[sign a message and create a signature]' \
+ '-e[embed the message after the signature]' \
+ '-m[file containing message]:message file:_files' \
+ '-s[secret key]:secret key:_files' \
+ '-x[signature file]:signature file:_files' \
+ '-z[embed signature in gzip header]' \
+ - verify \
+ '-V[verify the message and signature match]' \
+ '-e[extract the message from the signature]' \
+ '-m[file containing message to verify or destination to extract]:message file:_files' \
+ '-p[public key]:public key:_files' \
+ '-q[quiet mode]' \
+ '-t[restrict verification to specified key type]:key type:((base\:"base sets" fw\:firmware pkg\:packages syspatch\:syspatches))' \
+ '-x[signature file]:signature file:_files' \
+ '-z[verify signature in gzip header]'
diff --git a/Completion/BSD/Command/_vmctl b/Completion/BSD/Command/_vmctl
new file mode 100644
index 000000000..4e66c2383
--- /dev/null
+++ b/Completion/BSD/Command/_vmctl
@@ -0,0 +1,79 @@
+#compdef vmctl
+
+local context line state state_descr
+local -a subcommands vmctl_status
+local -A opt_args
+
+_vm_name() {
+ compadd "$@" - ${${${(@f)"$(_call_program vmctl_status vmctl status)"}[2,-1]}##* }
+}
+
+_vm_switch() {
+ [[ -r /etc/vm.conf ]] &&
+ compadd "$@" - ${${${(M)${(f)"$(</etc/vm.conf)"}:#switch *}##switch ##\"#}%%\"# *}
+}
+
+subcommands=(
+ console:'connect to the console of the VM'
+ create:'create a VM disk image'
+ load:'load additional configuration'
+ log:'change logging verbosity'
+ pause:'pause a VM'
+ receive:'receive a VM from stdin'
+ reload:'remove stopped VMs and reload config'
+ reset:'reset specified component'
+ send:'send VM to stdout and terminate it'
+ {show,status}:'list VMs running or just the specified id'
+ start:'start a VM'
+ stop:'stop a VM'
+ unpause:'unpause a VM'
+)
+
+if (( CURRENT == 2 )); then
+ _describe subcommand subcommands
+else
+ shift words; (( CURRENT-- ))
+ case $words[1] in
+ console|pause|send|show|status|stop|unpause)
+ _arguments ':id:_vm_name'
+ ;;
+ create)
+ _arguments \
+ ':path:_files' \
+ ': :(-s)' \
+ ':disk size in megabytes: '
+ ;;
+ load)
+ _arguments ':configuration file:_files'
+ ;;
+ log)
+ _arguments ':logging verbosity:(brief verbose)'
+ ;;
+ receive)
+ _arguments ':name: '
+ ;;
+ reset)
+ _arguments ':reset option:((
+ all\:"reset the running state"
+ switches\:"reset the configured switches"
+ vms\:"reset and terminate all VMs"
+ ))'
+ ;;
+ start)
+ if (( CURRENT == 2 )); then
+ _vm_name
+ else
+ shift words; (( CURRENT-- ))
+ _arguments -s \
+ '-b+[boot with the specified kernel or BIOS image]:boot image:_files' \
+ '-c[automatically connect to the VM console]' \
+ '*-d+[disk image file]:disk image:_files' \
+ '-i+[number of network interfaces]:number: ' \
+ '-L[add a local network interface]' \
+ '-m+[memory size in megabytes]:megabytes: ' \
+ '-n+[specify switch to attach]:switch:_vm_switch' \
+ '-r+[ISO image file for virtual CD-ROM]:ISO image:_files'
+ fi
+ ;;
+ esac
+fi
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2018-04-07 1:08 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-07 1:08 [patch] signify and vmctl completers Matthew Martin
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).