Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: update completions for openbsd 6.3



The new OpenBSD release has a few command option additions affecting
completions.

cu is not especially OpenBSD specific but _cu was written for it so I
added the new option along with a few common net/freebsd options but
more could be done to flesh it out for different systems. I tend to use
screen if I need a serial connection.

Otherwise, dhclient, script and uniq gained options. grep did too (-m)
but that's already completed.

Oliver

diff --git a/Completion/BSD/Command/_cu b/Completion/BSD/Command/_cu
index 8c0d1efef..90447c0af 100644
--- a/Completion/BSD/Command/_cu
+++ b/Completion/BSD/Command/_cu
@@ -1,7 +1,26 @@
 #compdef cu
 
-_arguments -s -A '-*' \
-  '-d[do not block waiting for a carrier to be detected]' \
+local args
+
+case $OSTYPE in
+  openbsd*)
+    args+=(
+      "-d[don't block waiting for a carrier to be detected]"
+      '-r[start cu in restricted mode - prevent local operations]'
+    )
+  ;;
+  (net|free)bsd*)
+    args+=(
+      '-a[set the acu port]:acu'
+      '(-o)-e[use even parity]'
+      '-h[echo characters locally]'
+      '(-e)-o[use odd parity]'
+      '-t[connect via a hard-wired connection to a host on a dial-up line]'
+    )
+  ;;
+esac
+
+_arguments -s -A '-*' $args \
   '-l[line to use]:line:(/dev/(cuaU#<->|ttyS<->)(N%c))' \
   '-s[line speed]:line speed:_baudrates' \
   '(-*)1:host:'
diff --git a/Completion/Unix/Command/_dhclient b/Completion/Unix/Command/_dhclient
index b5889df21..57a5061c2 100644
--- a/Completion/Unix/Command/_dhclient
+++ b/Completion/Unix/Command/_dhclient
@@ -14,6 +14,7 @@ case $OSTYPE in
       '(-d)-b[immediately move to the background]'
       '-p+[specify PID file]:file:_files'
       '-u[reject leases with unknown options]'
+      '-q[quiet]'
     )
   ;;
   openbsd*)
@@ -21,6 +22,7 @@ case $OSTYPE in
       '-i+[ignore values provided by leases for specified options]:options'
       '-L+[specify file to write option data too]:file:_files'
       "-n[don't configure any interfaces]"
+      '-v[verbose log messages]'
     )
   ;;
   *) # ISC implementation, used on Linux and NetBSD
@@ -34,6 +36,7 @@ case $OSTYPE in
       "-w[don't exit if there are no interfaces found to configure]"
       "-n[don't configure any interfaces]"
       '-e[specify env vars to pass to child processes]:env var key value pairs'
+      '-q[quiet]'
       '(-x)-r[release the current lease]'
       '(-r)-x[stop the running DHCP client without releaseing current lease]'
       '-p[specify port to transmit to / listen on]:port:_ports'
@@ -67,6 +70,5 @@ case $OSTYPE in
 esac
 
 _arguments -s -S -A "-*" $args \
-  '-q[quiet]' \
   '(-b -nw)-d[remain as a foreground process]' \
   ':interface:_net_interfaces'
diff --git a/Completion/Unix/Command/_script b/Completion/Unix/Command/_script
index 7f682eaa2..dfe57a796 100644
--- a/Completion/Unix/Command/_script
+++ b/Completion/Unix/Command/_script
@@ -42,12 +42,14 @@ case $OSTYPE in
       '(-d -p)-r[record a session with input, output and timing data]'
     )
   ;|
-  netbsd*)
+  netbsd*|openbsd*)
     args+=(
-      '-f[flush output after each write]'
       '-c[run specified command instead of a shell]:command:_cmdstring'
     )
   ;|
+  netbsd*)
+    args+=( '-f[flush output after each write]' )
+  ;|
   freebsd*)
     args+=(
       '-f[use filemon(4)]'
diff --git a/Completion/Unix/Command/_uniq b/Completion/Unix/Command/_uniq
index 6973cb312..97f73b3ac 100644
--- a/Completion/Unix/Command/_uniq
+++ b/Completion/Unix/Command/_uniq
@@ -22,7 +22,7 @@ args=(
 
 if ! _pick_variant gnu=Free\ Soft unix --version; then
   local optchars="cdufs"
-  if [[ "$OSTYPE" == (darwin|dragonfly|freebsd)* ]]; then
+  if [[ "$OSTYPE" == (darwin|dragonfly|freebsd|openbsd)* ]]; then
     optchars="${optchars}i"
   fi
   args=( ${(M)args:#(|\*)(|\(*\))-[$optchars]*} )



Messages sorted by: Reverse Date, Date, Thread, Author