diff options
| author | Igor Murzov <e-mail@date.by> | 2011-11-20 20:45:08 +0300 |
|---|---|---|
| committer | Igor Murzov <e-mail@date.by> | 2011-11-20 20:58:08 +0300 |
| commit | d26ede488cbb64bc2faec50976f2cc1b313a88aa (patch) | |
| tree | e6a12854d4d0322aeedfe7817d2e41c325f84ddf /completions | |
| parent | ed1703497476eaf12e1d630caf4caa4aabc3acdc (diff) | |
| download | bash-completion-d26ede488cbb64bc2faec50976f2cc1b313a88aa.tar.gz | |
valgrind: More generic tools detection.
Libdir is still hardcoded though.
Diffstat (limited to 'completions')
| -rw-r--r-- | completions/valgrind | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/completions/valgrind b/completions/valgrind index 446f0962..d1834526 100644 --- a/completions/valgrind +++ b/completions/valgrind @@ -30,13 +30,11 @@ _valgrind() ;; --tool) # Tools seem to be named e.g. like memcheck-amd64-linux from which - # we want to grab memcheck; the same dir may contain things like - # default.supp, vgpreload_*.so etc which we want to skip. - # TODO: probably needs adjustment to be more generic - COMPREPLY=( $( compgen -W "$( \ - command ls -1 /usr{,/local}/lib{,64}/valgrind 2>/dev/null | \ - sed -e '/\.so$/d' -ne 's/^\(.*\)-\([^-]*\)-\([^-]*\)/\1/p' )" \ - -- "$cur" ) ) + # we want to grab memcheck. + COMPREPLY=( $( for f in /usr{,/local}/lib{,64}/valgrind/*; do + [[ $f != *.so && -x $f ]] && + sed -ne "s/^.*\/\($cur.*\)-\([^-]*\)-\([^-]*\)/\1/p" <<<$f + done) ) return ;; --sim-hints) |
