summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Terbeck <bewater@users.sourceforge.net>2011-04-21 21:05:48 +0000
committerFrank Terbeck <bewater@users.sourceforge.net>2011-04-21 21:05:48 +0000
commit2b9f9b59e2380d176eb026b1a90073abb21a2533 (patch)
tree75e2617379f18713aee07df99561ef43b6221483
parent37bb9f7353e1a4510f0a52400cf257e27e3e793c (diff)
downloadzsh-2b9f9b59e2380d176eb026b1a90073abb21a2533.tar.gz
zsh-2b9f9b59e2380d176eb026b1a90073abb21a2533.zip
29027: _screen: support "/dev/ttyUSB0 [baud]"-style arguments.
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/_screen14
2 files changed, 17 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 0b6f3c6e7..5256d866a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* Valentin Haenel: 29019, Completion/Unix/Command/_git: Fix git
stash completion (apply and pop subcommands).
+ * 29027: Completion/Unix/Command/_screen: support "/dev/ttyUSB0
+ [baud]"-style arguments.
+
2011-04-19 Peter Stephenson <pws@csr.com>
* unposted: Completion/X/Command/.distfiles, Config/version.mk:
@@ -14490,5 +14493,5 @@
*****************************************************
* This is used by the shell to define $ZSH_PATCHLEVEL
-* $Revision: 1.5255 $
+* $Revision: 1.5256 $
*****************************************************
diff --git a/Completion/Unix/Command/_screen b/Completion/Unix/Command/_screen
index 4d3b08934..931946c78 100644
--- a/Completion/Unix/Command/_screen
+++ b/Completion/Unix/Command/_screen
@@ -3,6 +3,18 @@
local curcontext="$curcontext" state line expl
local scr_cmds sessions
+function __screen_normal() {
+ if (( CURRENT == 1 )) && [[ $PREFIX == /dev/* ]]; then
+ _path_files -g '*(%)'
+ elif (( CURRENT == 2 )) && [[ ${words[1]} == /dev/* ]]; then
+ _message "baud rate"
+ elif (( CURRENT > 2 )) && [[ ${words[1]} == /dev/* ]]; then
+ _message "no more parameters"
+ else
+ _normal "$@"
+ fi
+}
+
scr_cmds=(
acladd aclchg acldel aclgrp
aclumask activity addacl allpartial
@@ -91,7 +103,7 @@ _arguments -C \
'-Dx: :->any-sessions' \
'-dx: :->any-sessions' \
'-X[execute command as a screen command in the specified session]:screencmd:(${scr_cmds[@]})' \
- '*::arguments: _normal'
+ '*::arguments: __screen_normal'
if [[ -n $state ]]; then
case $state in