From 2b9f9b59e2380d176eb026b1a90073abb21a2533 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Thu, 21 Apr 2011 21:05:48 +0000 Subject: 29027: _screen: support "/dev/ttyUSB0 [baud]"-style arguments. --- Completion/Unix/Command/_screen | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'Completion/Unix/Command/_screen') 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 -- cgit 1.4.1