Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: handle more options in cu completion
- X-seq: zsh-workers 43330
- From: Oliver Kiddle <okiddle@xxxxxxxxxxx>
- To: Zsh workers <zsh-workers@xxxxxxx>
- Subject: PATCH: handle more options in cu completion
- Date: Fri, 24 Aug 2018 07:59:47 +0200
- Authentication-results: amavisd4.gkg.net (amavisd-new); dkim=pass (2048-bit key) header.d=yahoo.co.uk
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.co.uk; s=s2048; t=1535090392; bh=5IKw1jOwMp4ZwZ0PrvN3PZJWtz6yE7Up2eK9XERDXUg=; h=From:To:Subject:Date:From:Subject; b=m54RmbgLDGwsH/9AFdcaSlOXTT9rSX53MRnZzxBl06ewPcCJmUxXuIgL9JhNIId1c3afOKpGOIME9U1STOLiSahCeuv5eCcUxQYz06DQp+HYV+RX/oHaLF18NxlQMc80Raq8DAihqDk6uw/OsSJ8V1hhZMZIGTohgCMF/QLPul25FQ4Z9clng/T6SpiDbMkDbHzNBH/aus2J8LyvqCeckJUbWHRzzD5oE5Cc8mAFD8C3el9UsFC9Su4QUB91qi2/UH7BY7GZFA+OtCcKFrhUuPJpZC3diGXbyGybOsAm7OT090OFNSpENtm6UI39VCpwNS5WQs2KA1y8lZq4QTilSQ==
- List-help: <mailto:zsh-workers-help@zsh.org>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:zsh-workers@zsh.org>
- List-unsubscribe: <mailto:zsh-workers-unsubscribe@zsh.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
This expands the option handling in the cu completion. This covers
netbsd and the cu from Ian Lance Taylor's UUCP tools.
Oliver
diff --git a/Completion/BSD/Command/_cu b/Completion/BSD/Command/_cu
index 90447c0af..1fe08601f 100644
--- a/Completion/BSD/Command/_cu
+++ b/Completion/BSD/Command/_cu
@@ -1,26 +1,67 @@
#compdef cu
-local args
+local variant ign
+local -a args
-case $OSTYPE in
+_pick_variant -r variant taylor='Taylor UUCP' $OSTYPE --version
+
+case $variant 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*)
+ taylor|(net|free)bsd*)
args+=(
+ '(-o -P --parity)-e[use even parity]'
+ '(-e -P --parity)-o[use odd parity]'
+ )
+ ;|
+ (net|free)bsd*)
+ args+=( '-t[connect via a hard-wired connection to a host on a dial-up line]' )
+ ;|
+ taylor|netbsd*)
+ (( $#words > 2 )) && ign='!'
+ args+=(
+ "${ign}--help[display usage information]"
+ '(-s)--speed=[set line speed for the connection]:line speed [9600]:_baudrates'
+ '(-e -o -P)--parity=[set parity]:parity [none]:(even odd none)'
+ '(-h --halfduplex)'{-h,--halfduplex}'[echo characters locally]'
+ '--nostop[turn off XON/XOFF handling]'
+ '(-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))'
+ )
+ ;|
+ taylor)
+ args+=(
+ "${ign}(-v --version)"{-v,--version}"[display version information]"
+ '(-n --prompt -c --phone)'{-n,--prompt}'[prompt for the phone number to use]'
+ '(-x --debug)-d[enter debugging mode]'
+ '(-d -x --debug)'{-x+,--debug=}'[turn on particular debugging types]:debug type:_sequence compadd - all abnormal chat handshake port config incoming outgoing'
+ '(-I --config)'{-I+,--config=}'[specify configuration file]:configuration file:_files'
+ '(1 -z --system)'{-z+,--system=}'[specify system to call]:system'
+ )
+ ;;
+ netbsd*)
+ args+=(
+ '(-E --escape)-n+[disable escape character processing]'
+ '(-f -F --flow)'{-F+,--flow=}'[set flow control]:flow control:(hard soft none)'
+ '(-F --flow)-f[use no flow control]'
+ '(-e -o --parity)-P+[set parity]:parity [none]:(even odd none)'
+ )
+ ;;
+ freebsd*)
+ args=( -A "-*" $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:'
+_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: :_guard "^-*" system'
Messages sorted by:
Reverse Date,
Date,
Thread,
Author