1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-11-30 03:50:56 +01:00

Initial revision

This commit is contained in:
Tanaka Akira 1999-08-23 10:07:44 +00:00
parent 0066a6a007
commit c21b91b916
5 changed files with 115 additions and 0 deletions

View file

@ -0,0 +1,4 @@
#autoload
compset -P '*:'
_files -S: -r ': \t\t\-' -/

View file

@ -0,0 +1,49 @@
#autoload
# This should be called from `_arguments' or otherwise the calling
# function has to set up an array named `line' that contains the
# name of the executable as its seconf element or it has to supply
# that name as an argument.
# One option is recognized: `-p' means that we are completing a pair
# of names separated by a slash.
local cmd pair expl
if [[ "$1" = -p ]]; then
pair=yes
shift
fi
if (( $# )); then
cmd="$1"
elif [[ $#line -gt 1 ]]; then
cmd="$line[2]"
else
return 1
fi
if [[ -n "$cmd" ]]; then
if [[ "$cmd" = /* ]]; then
tmp="$cmd"
else
tmp="$PWD/$cmd"
fi
if [[ "$tmp" != "$_es_command" ]]; then
_es_command="$tmp"
_es_funcs=( "${(@)${(@M)${(@f)$(nm $cmd)}:#[^ ]# [tT] ([^_]|_[^_])*}##* }" )
fi
if [[ -n "$pair" ]]; then
if compset -P '*/'; then
_description expl 'call arc to function'
else
_description expl 'call arc from function'
fi
else
_description expl function
fi
compadd -M 'r:|_=* r:|=*' - "$_es_funcs[@]"
else
return 1
fi

12
Completion/User/_gprof Normal file
View file

@ -0,0 +1,12 @@
#compdef gprof
_arguments -s -{a,b,c,D,h,i,l,L,s,T,v,w,x,y,z} \
-{A,C,e,E,f,F,J,n,N,O,p,P,q,Q,Z}:'function name: _exec_funcs' \
'-I:directory:_dir_list' \
'-d-:debug level:' '-k:function names: _exec_funcs -p' \
'-m:minimum execution count:' \
':executable:_files -g *(*)' \
':profile file:_files -g gmon.*' \
-- -s '(#--[no-] --)' \
'*=name*:function name: _exec_funcs' \
'*=dirs*:directory:_dir_list'

6
Completion/User/_users Normal file
View file

@ -0,0 +1,6 @@
#autoload
local expl
_description expl user
compgen "$@" "$expl[@]" -u