zsh-workers
 help / color / mirror / code / Atom feed
* valgrind completion, order of completed values
@ 2009-10-18 11:26 Mikael Magnusson
  2011-05-23  0:21 ` PATCH: Update horrible hack for completing valgrind tools Mikael Magnusson
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2009-10-18 11:26 UTC (permalink / raw)
  To: zsh-workers

I noticed the --read-var-info option wasn't completed and went to add
it, when I noticed the completion function has (yes no), but when
completing the no comes first, presumably alphabetical sorting is done
somewhere. This is also a bit weird for ones like (low med high) and
(no some all). Is there any way to work around that? I also noticed
--leak-resolution was missing the description so (low med high) was
actually displayed as the description and nothing was completed.
Here's a patch for these two.

diff --git a/Completion/Linux/Command/_valgrind
b/Completion/Linux/Command/_valgrind
index 3da65e9..486010b 100644
--- a/Completion/Linux/Command/_valgrind
+++ b/Completion/Linux/Command/_valgrind
@@ -20,6 +20,10 @@ common=(
   '--alignment=-[set minimum alignment of allocations]:number'
 )

+common_read_varinfo=(
+  '--read-var-info=-[read DWARF3 debug info]:enable:(yes no)'
+)
+
 common_mem_null=(
   '--xml=-[output everything in XML]:enable:(yes no)'
   '--xml-user-comment=-[copy specified string verbatim to XML output]:string'
@@ -31,13 +35,14 @@ args_addrcheck=(
   '--partial-loads-ok=-:enable:(yes no)'
   '--freelist-vol=-[volume of freed blocks queue]:blocks'
   '--leak-check=-[search for memory leaks at exit]:enable:(yes no)'
-  '--leak-resolution=-[how much bt merging in leak check]:(low med high)'
+  '--leak-resolution=-[how much bt merging in leak check]:level:(low med high)'
   '--show-reachable=-[show reachable blocks in leak check]:enable:(yes no)'
   '--workaround-gcc296-bugs=-:enable:(yes no)'
 )

 args_memcheck=(
   $args_addrcheck
+  $common_read_varinfo
 )

 args_cachegrind=(
@@ -48,6 +53,7 @@ args_cachegrind=(

 args_helgrind=(
   $common
+  $common_read_varinfo
   '--private-stacks=-[assume thread stacks are used privately]:enable:(yes no)'
   '--show-last-access=-[show location of last word access on
error]:locations:(no some all)'
 )






I also noticed --tool no longer works, it seems the files have
-x86-linux appended to them, so I tried this fix, but :s doesn't do
anything.

@@ -112,7 +118,7 @@ if [[ -n "$state" ]]; then
   # Basically uses debug output to find out the directory where the tools are
   # present and lists all executables in that directory.
   # Hope the program provides a neater interface some day!
-  tools=(${${${(M)${(f)"$(_call_program tools valgrind
--tool=something -d 2> /dev/null)"}:#*launcher launching
*something}##*launcher launching }%%something}*(*:t))
+  tools=(${${${(M)${(f)"$(_call_program tools valgrind
--tool=something -d 2>&1)"}:#*launcher launching
*something*}##*launcher launching }%%something*}*~*.so(*:t:s/-*//))
   _wanted tools exl 'valgrind tool' compadd $tools && return
 fi

if I run it at the command prompt, it does work though, and I can't
recall any option that turns off :s// there.

-- 
Mikael Magnusson


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

* PATCH: Update horrible hack for completing valgrind tools
  2009-10-18 11:26 valgrind completion, order of completed values Mikael Magnusson
@ 2011-05-23  0:21 ` Mikael Magnusson
  0 siblings, 0 replies; 2+ messages in thread
From: Mikael Magnusson @ 2011-05-23  0:21 UTC (permalink / raw)
  To: zsh-workers

On 18 October 2009 13:26, Mikael Magnusson <mikachu@gmail.com> wrote:
>
> I also noticed --tool no longer works, it seems the files have
> -x86-linux appended to them, so I tried this fix, but :s doesn't do
> anything.
>
[horrible patch]
>
> if I run it at the command prompt, it does work though, and I can't
> recall any option that turns off :s// there.

I remembered now, it's histsubstpattern ;).

---
 Completion/Linux/Command/_valgrind |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
also horrible patch:
diff --git a/Completion/Linux/Command/_valgrind b/Completion/Linux/Command/_valgrind
index 34d2f77..0284ff8 100644
--- a/Completion/Linux/Command/_valgrind
+++ b/Completion/Linux/Command/_valgrind
@@ -118,7 +118,11 @@ if [[ -n "$state" ]]; then
   # Basically uses debug output to find out the directory where the tools are
   # present and lists all executables in that directory.
   # Hope the program provides a neater interface some day!
-  tools=(${${${(M)${(f)"$(_call_program tools valgrind --tool=something -d 2> /dev/null)"}:#*launcher launching *something}##*launcher launching }%%something}*(*:t))
+  () {
+    setopt localoptions histsubstpattern
+    tools=( ${${${(M)${(f)"$(_call_program tools valgrind --tool=something -d 2>&1)"}:#*launcher launching *something*}##*launcher launching }%%something*}*~*.*(*:t:s/-*//) )
+    typeset -U tools
+  }
   _wanted tools exl 'valgrind tool' compadd $tools && return
 fi
 
-- 
1.7.4-rc1


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

end of thread, other threads:[~2011-05-23  0:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-10-18 11:26 valgrind completion, order of completed values Mikael Magnusson
2011-05-23  0:21 ` PATCH: Update horrible hack for completing valgrind tools Mikael Magnusson

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