Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[patch] Completions for cu, fw_update, and rcctl
- X-seq: zsh-workers 37534
- From: Matthew Martin <phy1729@xxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: [patch] Completions for cu, fw_update, and rcctl
- Date: Sun, 10 Jan 2016 01:51:41 -0600
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; bh=31ZobaGSHhKfI1z3rqzz+b3ybEh9ejAfZwTGoftqF80=; b=RSvgHGIxXr0TMmo2FFBVDS7sp/Hh7t3Kv+zThILcXpJ6VZA82B/srjPqJbjpGlKcub 2uX2pdZBgvkFy1AxP2EpXt3EeZiMNo1YDtLhu9m45K3FqN6BEU10LJRsP8xaPYXJavok +xBiTwe48mfDLQBQ6vMDaRSLbvU9I152Iduo794OjTCb3LvGb5EeHHwu89fe3GTHkprz xvG32ai6cEMleQarBTBJqTI8w8g0AEMnYgXyHfbwJsBVboO1WuMDesjPJJJ6ZugNErj7 Rog2mDenCdQhO6FDlKb5gwGCqkAQZYLO4tS6VeTUDkvhFd+r2YIin+/0se2U2poeU4BJ n73g==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
Few completers for OpenBSD utilities that have been sitting in my tree.
Not sure if listing line speeds is overkill (fine by me to remove them
if anyone thinks it is).
diff --git a/Completion/BSD/Command/_cu b/Completion/BSD/Command/_cu
new file mode 100644
index 0000000..d4658e3
--- /dev/null
+++ b/Completion/BSD/Command/_cu
@@ -0,0 +1,7 @@
+#compdef cu
+
+_arguments -s -A '-*' \
+ '-d[do not block waiting for a carrier to be detected]' \
+ '-l[line to use]:line:(/dev/cuaU#<->(%))' \
+ '-s[line speed]:line speed:(75 110 300 1200 2400 4800 9600 19200 38400 57600 115200)' \
+ '(-*)1:host:'
diff --git a/Completion/BSD/Command/_fw_update b/Completion/BSD/Command/_fw_update
new file mode 100644
index 0000000..b01749f
--- /dev/null
+++ b/Completion/BSD/Command/_fw_update
@@ -0,0 +1,10 @@
+#compdef fw_update
+
+_arguments -s -S -A "-*" \
+ '(*)-a[install or update firmware for all drivers]' \
+ '-d[delete drivers instead of adding them]' \
+ '-i[display information]' \
+ '-n[dry run]' \
+ '-p[use the firmware at specified path]:path:' \
+ '*-v[verbose output]' \
+ '(-a)*:driver:'
diff --git a/Completion/BSD/Command/_rcctl b/Completion/BSD/Command/_rcctl
new file mode 100644
index 0000000..24fa04f
--- /dev/null
+++ b/Completion/BSD/Command/_rcctl
@@ -0,0 +1,42 @@
+#compdef rcctl
+
+local context state line
+local -a actions subcmds variables
+
+actions=(check reload restart start stop)
+subcmds=(disable enable get getdef ls order set)
+variables=(class flags status timeout user)
+
+if [[ $service == "rcctl" ]]; then
+ _arguments -C \
+ '-d[print debug information]' \
+ '-f[forcibly start the daemon]' \
+ ':subcommand:('"$actions ${${${+words[(r)-[df]]}#1}/0/$subcmds}"\) \
+ '*:: :->subcmd' && return
+ service="$words[1]"
+fi
+
+case $service in
+ get|getdef)
+ _arguments \
+ ':service:_services' \
+ ':variable:compadd -a variables'
+ ;;
+ ls)
+ _arguments ':display a list of services and daemons matching:(all faulty off on started stopped)'
+ ;;
+ order)
+ _arguments \
+ ':service to start first:_services'
+ '*:service to start next:_services'
+ ;;
+ set)
+ _arguments \
+ ':service:_services' \
+ ':variable:compadd -a variables' \
+ '*:argument:'
+ ;;
+ ${(~j:|:)actions}|disable|enable)
+ _arguments "*:service to $words[2]:_services"
+ ;;
+esac
Messages sorted by:
Reverse Date,
Date,
Thread,
Author