Move __fish_print_function_prototypes into valgrind completion script

This commit is contained in:
Jason 2019-12-03 19:12:12 +09:00 committed by Fabian Homborg
parent 013001c283
commit 69dccce937
2 changed files with 7 additions and 8 deletions

View File

@ -72,6 +72,13 @@ complete -n "__fish_valgrind_skin cachegrind" -xc valgrind -l D1 -d "Type of L1
complete -n "__fish_valgrind_skin cachegrind" -xc valgrind -l L2 -d "Type of L2 cache"
function __fish_print_function_prototypes -d "Prints the names of all function prototypes found in the headers in the current directory"
set -l headers *.h *.hh *.hpp *.hxx
if set -q headers[1]
sed -n "s/^\(.*[^[a-zA-Z_0-9]\|\)\([a-zA-Z_][a-zA-Z_0-9]*\) *(.*);.*\$/\2/p" $headers
end
end
# Massif-specific options
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"'

View File

@ -1,8 +0,0 @@
function __fish_print_function_prototypes -d "Prints the names of all function prototypes found in the headers in the current directory"
set -l headers *.h *.hh *.hpp *.hxx
if set -q headers[1]
sed -n "s/^\(.*[^[a-zA-Z_0-9]\|\)\([a-zA-Z_][a-zA-Z_0-9]*\) *(.*);.*\$/\2/p" $headers
end
end