blob: d53170c5f78be93dc51267172183767a4e88197e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
#!/bin/zsh
generate-complete-function/ruby/optparse ()
{
local cmpl="_${1:t}"
mkdir -p "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}"
$1 "--*-completion-zsh=${1:t}" >! "${ZSH_COMPLETION_DIR-$HOME/.zsh.d/Completion}/$cmpl"
if [[ $(type -w "$cmpl") == "${cmpl}: function" ]]; then
unfunction "$cmpl"
autoload -U "$cmpl"
else
compinit "$cmpl"
fi
}
compdef _command generate-complete-function/ruby/optparse
for cmd in "$@"; do
generate-complete-function/ruby/optparse "$cmd"
done
|