aboutsummaryrefslogtreecommitdiffhomepage
path: root/share
diff options
context:
space:
mode:
authorGravatar axel <axel@liljencrantz.se>2006-02-24 23:56:18 +1000
committerGravatar axel <axel@liljencrantz.se>2006-02-24 23:56:18 +1000
commitdad2b93d1efe2e3827b6f9063391070fb9ffbe14 (patch)
tree259152f0f5008020afe45c29f9c7debc399fee96 /share
parent1075ca69b0ef393b78952c0de639252fb70d559d (diff)
Add functiopn prototype completions for valgrind --alloc-fn
darcs-hash:20060224135618-ac50b-bcd2fa57593f6a5c9f41b9513ac25f859baf1659.gz
Diffstat (limited to 'share')
-rw-r--r--share/completions/valgrind.fish4
-rw-r--r--share/functions/__fish_print_function_prototypes.fish5
2 files changed, 7 insertions, 2 deletions
diff --git a/share/completions/valgrind.fish b/share/completions/valgrind.fish
index aa4317bf..b29138ae 100644
--- a/share/completions/valgrind.fish
+++ b/share/completions/valgrind.fish
@@ -17,7 +17,7 @@ complete -xc valgrind -l $skin -d (_ "Skin") -a "
massif\tHeap\ profiler
"
-eval function __fish_valgrind_skin\; contains -- --$skin=\$argv \(commandline -cpo\)\;end
+eval "function __fish_valgrind_skin; contains -- --$skin=\$argv (commandline -cpo);end"
set -e $skin
@@ -66,7 +66,7 @@ complete -n "__fish_valgrind_skin cachegrind" -xc valgrind -l L2 -d (_ "Type of
# Massif-specific options
-complete -c valgrind -n "__fish_valgrind_skin massif" -l alloc-fn -d (_ "Specify a function that allocates memory") -x
+complete -c valgrind -n "__fish_valgrind_skin massif" -l alloc-fn -d (_ "Specify a function that allocates memory") -x -a "(__fish_print_function_prototypes)"
complete -c valgrind -n "__fish_valgrind_skin massif" -x -l heap -d 'Profile heap usage' -a 'yes\t"Profile heap usage" no\t"Do not profile heap usage"'
complete -c valgrind -n "__fish_valgrind_skin massif" -x -l heap-admin -d (_ "The number of bytes of heap overhead per allocation")
complete -c valgrind -n "__fish_valgrind_skin massif" -x -l stacks -d (_ "Profile stack usage") -a 'yes\t"Profile stack usage" no\t"Do not profile stack usage"'
diff --git a/share/functions/__fish_print_function_prototypes.fish b/share/functions/__fish_print_function_prototypes.fish
new file mode 100644
index 00000000..14871352
--- /dev/null
+++ b/share/functions/__fish_print_function_prototypes.fish
@@ -0,0 +1,5 @@
+
+function __fish_print_function_prototypes -d "Prints the names of all function prototypes found in the headers in the current directory"
+ cat *.h*|sed -n "s/^\(.*[^[a-zA-Z_0-9]\|\)\([a-zA-Z_][a-zA-Z_0-9]*\) *(.*);.*\$/\2/p"
+end
+