zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH 2/4] _rsync: fix rsync remote file completion (ALT#12958).
@ 2009-04-12 11:15 Alexey I. Froloff
  2009-04-12 11:15 ` [PATCH 3/4] _screen: fix session completion (ALT#16702) Alexey I. Froloff
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey I. Froloff @ 2009-04-12 11:15 UTC (permalink / raw)
  To: zsh workers; +Cc: Alexey I. Froloff

rsync shows exactly five fields, separated by one or more spaces:

attributes    size date time file or directory name

In this example "file or directory name" should be completed, so exactly
four fileds should be stripped out.

Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
---
 Completion/Unix/Command/_rsync |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
index 34d4260..c26c05f 100644
--- a/Completion/Unix/Command/_rsync
+++ b/Completion/Unix/Command/_rsync
@@ -31,11 +31,14 @@ if compset -P '*::*/' || compset -P 'rsync://*/*/'; then
   remdispf=(${remfiles:#d*})
   remdispd=(${(M)remfiles:#d*})
 
+  # $remdisp[fd] format:
+  # attrs  size  date  time  name
+
   _wanted files expl 'remote file or directory' \
-      compadd -d remdispf ${remdispf##* }
+      compadd -d remdispf ${${${${remdispf##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}
 
   _wanted files expl 'remote file or directory' \
-      compadd -S/ -d remdispd ${remdispd##* }
+      compadd -S/ -d remdispd ${${${${remdispd##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}##[^ ]## ##}
 
 elif compset -P 1 '*::' || compset -P 1 'rsync://*/'; then
 
-- 
1.6.1.3.GIT


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3/4] _screen: fix session completion (ALT#16702).
  2009-04-12 11:15 [PATCH 2/4] _rsync: fix rsync remote file completion (ALT#12958) Alexey I. Froloff
@ 2009-04-12 11:15 ` Alexey I. Froloff
  2009-04-12 11:15   ` [PATCH 4/4] _man: strip section and extension from all manual pages Alexey I. Froloff
  0 siblings, 1 reply; 3+ messages in thread
From: Alexey I. Froloff @ 2009-04-12 11:15 UTC (permalink / raw)
  To: zsh workers; +Cc: Alexey I. Froloff

screen -ls prints pretty header and footer on stderr.  Filter it out
(patch by Evgenii Terechkov <evg@altlinux.org>).

Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
---
 Completion/Unix/Command/_screen |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Completion/Unix/Command/_screen b/Completion/Unix/Command/_screen
index be0e355..67c453a 100644
--- a/Completion/Unix/Command/_screen
+++ b/Completion/Unix/Command/_screen
@@ -98,19 +98,19 @@ if [[ -n $state ]]; then
     attached-sessions)
       sessions=(
         ${${${(M)${(f)"$(_call_program screen-sessions $words[1] \
-            -ls)"}:#*[Aa]ttached*}##[[:blank:]]}%%[[:blank:]]*}
+            -ls 2>/dev/null)"}:#*[Aa]ttached*}##[[:blank:]]}%%[[:blank:]]*}
       )
     ;;
     detached-sessions)
       sessions=(
         ${${${(M)${(f)"$(_call_program screen-sessions $words[1] \
-            -ls)"}:#*[Dd]etached*}##[[:blank:]]}%%[[:blank:]]*}
+            -ls 2>/dev/null)"}:#*[Dd]etached*}##[[:blank:]]}%%[[:blank:]]*}
       )
     ;;
     any-sessions)
       sessions=(
         ${${${(M)${(f)"$(_call_program screen-sessions $words[1] \
-	    -ls)"}:#*tached*}##[[:blank:]]}%%[[:blank:]]*}
+	    -ls 2>/dev/null)"}:#*tached*}##[[:blank:]]}%%[[:blank:]]*}
       )
   esac
 
-- 
1.6.1.3.GIT


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 4/4] _man: strip section and extension from all manual pages.
  2009-04-12 11:15 ` [PATCH 3/4] _screen: fix session completion (ALT#16702) Alexey I. Froloff
@ 2009-04-12 11:15   ` Alexey I. Froloff
  0 siblings, 0 replies; 3+ messages in thread
From: Alexey I. Froloff @ 2009-04-12 11:15 UTC (permalink / raw)
  To: zsh workers; +Cc: Alexey I. Froloff

Before:

$ man n op<Tab>
---- manual page, section n ----
open.n.gz      optimize.n.gz  option.n.gz    options.n.bz2

After:

$ man n op
---- manual page, section n ----
open      optimize  option    options

Signed-off-by: Alexey I. Froloff <raorn@altlinux.org>
---
 Completion/Unix/Command/_man |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Completion/Unix/Command/_man b/Completion/Unix/Command/_man
index 8f28d34..dc5bb1f 100644
--- a/Completion/Unix/Command/_man
+++ b/Completion/Unix/Command/_man
@@ -98,9 +98,9 @@ _man_pages() {
   if ((CURRENT > 2)) ||
       ! zstyle -t ":completion:${curcontext}:manuals.$sect" insert-sections
   then
-    compadd "$@" - ${pages%.(?|<->*(|.gz|.bz2|.Z))}
+    compadd "$@" - ${pages%.((?|<->*)(|.gz|.bz2|.Z))}
   else
-    compadd "$@" -P "$sopt$sect " - ${pages%.(?|<->*(|.gz|.bz2|.Z))}
+    compadd "$@" -P "$sopt$sect " - ${pages%.((?|<->*)(|.gz|.bz2|.Z))}
   fi
 }
 
-- 
1.6.1.3.GIT


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-04-12 11:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-12 11:15 [PATCH 2/4] _rsync: fix rsync remote file completion (ALT#12958) Alexey I. Froloff
2009-04-12 11:15 ` [PATCH 3/4] _screen: fix session completion (ALT#16702) Alexey I. Froloff
2009-04-12 11:15   ` [PATCH 4/4] _man: strip section and extension from all manual pages Alexey I. Froloff

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).