zsh-workers
 help / color / mirror / code / Atom feed
From: "O'Connor, Daniel" <darius@dons.net.au>
To: zsh-workers@zsh.org
Subject: Fix cu completion for OSX
Date: Sat, 17 Nov 2018 12:12:32 +1030	[thread overview]
Message-ID: <FFA1877E-DBB8-4705-B5B4-859A1E755814@dons.net.au> (raw)

Hi,
I use cu for Arduino stuff and habitually type cu -l /dev/cu.<tab> and get annoyed it doesn't match anything.
OSX has ttys named cu.* and tty.* and uses Taylor CU.

This patch works for me (tm).

--- _cu.orig	2018-11-17 11:54:18.000000000 +1030
+++ _cu	2018-11-17 12:07:43.000000000 +1030
@@ -32,7 +32,7 @@
       '(-E --escape)'{-E+,--escape=}'[specify escape character]:escape character [~]'
       '(-a -p --port)'{-a+,-p+,--port=}'[specify the port]:port'
       '(-c --phone -n --prompt)'{-c+,--phone=}'[specify phone number to call]:phone number'
-      '(1 -l -z --system)--line=[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*)(N%c))'
+      '(1 -l -z --system)--line=[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*|cu.*)(N%c))'
     )
   ;|
   taylor)
@@ -63,5 +63,5 @@

 _arguments -s $args \
   '(--speed)-s+[set line speed for the connection]:line speed [9600]:_baudrates' \
-  '(1 --line -z --system)-l+[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*)(N%c))' \
+  '(1 --line -z --system)-l+[specify line to use]:line:(/dev/(cuaU#<->|ttyS<->|tty.*|cu.*)(N%c))' \
   '1: :_guard "^-*" system'

--
Daniel O'Connor
"The nice thing about standards is that there
are so many of them to choose from."
 -- Andrew Tanenbaum



                 reply	other threads:[~2018-11-17  2:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FFA1877E-DBB8-4705-B5B4-859A1E755814@dons.net.au \
    --to=darius@dons.net.au \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).