zsh-users
 help / color / mirror / code / Atom feed
* kill and wait completion
@ 1999-09-19 19:12 pollux
  1999-09-19 23:08 ` Bart Schaefer
  0 siblings, 1 reply; 2+ messages in thread
From: pollux @ 1999-09-19 19:12 UTC (permalink / raw)
  To: zsh-users


Hi,

Shouldn't `_kill' and `_wait' completion functions split 
`$compconfig[ps_args]' and `$compconfig[ps_listargs]' at spaces ?


*** _kill.old	Sat Sep 18 10:26:45 1999
--- _kill	Sat Sep 18 10:44:07 1999
***************
*** 1,5 ****
--- 1,6 ----
  #compdef kill
  
+ setopt local_options sh_word_split
  local list expl
  
  if compset -P 1 -; then
*** _wait.old	Sun Sep 19 20:58:14 1999
--- _wait	Sun Sep 19 20:59:14 1999
***************
*** 11,16 ****
--- 11,17 ----
  #    options for the ps command that are to be used when creating
  #    the list to display during completion.
  
+ setopt local_options sh_word_split
  local list ret=1 expl
  
  _description expl job


--
Alexandre 'Pollux' Duret-Lutz


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

* Re: kill and wait completion
  1999-09-19 19:12 kill and wait completion pollux
@ 1999-09-19 23:08 ` Bart Schaefer
  0 siblings, 0 replies; 2+ messages in thread
From: Bart Schaefer @ 1999-09-19 23:08 UTC (permalink / raw)
  To: zsh-users

On Sep 19,  9:12pm, pollux wrote:
} Subject: kill and wait completion
}
} Shouldn't `_kill' and `_wait' completion functions split 
} `$compconfig[ps_args]' and `$compconfig[ps_listargs]' at spaces ?

Possibly, but not by using setopt sh_word_split.

And if those two should do it, then so should _gdb.

This patch is _instead_ of zsh-users/2609.

Index: Completion/Builtins/_kill
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Completion/Builtins/_kill,v
retrieving revision 1.8
diff -u -r1.8 _kill
--- _kill	1999/09/15 15:31:26	1.8
+++ _kill	1999/09/19 23:07:14
@@ -10,9 +10,9 @@
 
   _description expl job
   compgen "$expl[@]" -P '%' -j && ret=0
-  list=("${(@Mr:COLUMNS-1:)${(f@)$(ps ${compconfig[ps_listargs]:-$compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
+  list=("${(@Mr:COLUMNS-1:)${(f@)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
   _description expl 'process ID'
-  compadd "$expl[@]" -ld list - ${${${(f)"$(ps $compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} &&
+  compadd "$expl[@]" -ld list - ${${${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} &&
     ret=0
 
   return ret
Index: Completion/Builtins/_wait
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Completion/Builtins/_wait,v
retrieving revision 1.7
diff -u -r1.7 _wait
--- _wait	1999/09/15 15:31:26	1.7
+++ _wait	1999/09/19 23:07:14
@@ -15,8 +15,8 @@
 
 _description expl job
 compgen "$expl[@]" -P '%' -j && ret=0
-list=("${(@Mr:COLUMNS-1:)${(f)$(ps ${compconfig[ps_listargs]:-$compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
+list=("${(@Mr:COLUMNS-1:)${(f)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*}")
 _description expl 'process ID'
-compadd "$expl[@]" -ld list - ${${${(f)"$(ps $compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} && ret=0
+compadd "$expl[@]" -ld list - ${${${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}[2,-1]## #}%% *} && ret=0
 
 return ret
Index: Completion/User/_gdb
===================================================================
RCS file: /extra/cvsroot/zsh/zsh-3.1/Completion/User/_gdb,v
retrieving revision 1.7
diff -u -r1.7 _gdb
--- _gdb	1999/09/15 15:31:35	1.7
+++ _gdb	1999/09/19 23:07:14
@@ -47,9 +47,9 @@
   if [[ $#w -gt 1 ]]; then
     _files && ret=0
     _description expl 'process ID'
-    list=("${(F)${(@Mr:COLUMNS-1:)${(f)$(ps ${compconfig[ps_listargs]:-$compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*${w[1]:t}}}
+    list=("${(F)${(@Mr:COLUMNS-1:)${(f)$(ps ${=compconfig[ps_listargs]:-$=compconfig[ps_args]} 2>/dev/null)}[2,-1]:#[ 	]#${PREFIX}[0-9]#${SUFFIX}[ 	]*${w[1]:t}}}
 ")
-    compadd "$expl[@]" -ld list - ${${${(M)${(f)"$(ps $compconfig[ps_args] 2>/dev/null)"}:#*${w[1]:t}*}## #}%% *} && ret=0
+    compadd "$expl[@]" -ld list - ${${${(M)${(f)"$(ps $=compconfig[ps_args] 2>/dev/null)"}:#*${w[1]:t}*}## #}%% *} && ret=0
 
     return ret
   else


-- 
Bart Schaefer                                 Brass Lantern Enterprises
http://www.well.com/user/barts              http://www.brasslantern.com


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

end of thread, other threads:[~1999-09-19 23:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-09-19 19:12 kill and wait completion pollux
1999-09-19 23:08 ` Bart Schaefer

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