95e6feaf761ee1dffb8b5c49542852231e5e1a4b
- Author
- Robby Russell <robby@planetargon.com>
- Committer
- Robby Russell <robby@planetargon.com>
- Date
Message
Diff
This diff is truncated to protect this page.
1diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
2deleted file mode 100644
3index 23afa96569e18d426125cd48921786e59a1faa2c..0000000000000000000000000000000000000000
4--- a/plugins/go/go.plugin.zsh
5+++ /dev/null
6@@ -1,151 +0,0 @@
7-# install in /etc/zsh/zshrc or your personal .zshrc
8-
9-# gc
10-prefixes=(5 6 8)
11-for p in $prefixes; do
12- compctl -g "*.${p}" ${p}l
13- compctl -g "*.go" ${p}g
14-done
15-
16-# standard go tools
17-compctl -g "*.go" gofmt
18-
19-# gccgo
20-compctl -g "*.go" gccgo
21-
22-# go tool
23-__go_tool_complete() {
24- typeset -a commands build_flags
25- commands+=(
26- 'build[compile packages and dependencies]'
27- 'clean[remove object files]'
28- 'doc[run godoc on package sources]'
29- 'fix[run go tool fix on packages]'
30- 'fmt[run gofmt on package sources]'
31- 'get[download and install packages and dependencies]'
32- 'help[display help]'
33- 'install[compile and install packages and dependencies]'
34- 'list[list packages]'
35- 'run[compile and run Go program]'
36- 'test[test packages]'
37- 'tool[run specified go tool]'
38- 'version[print Go version]'
39- 'vet[run go tool vet on packages]'
40- )
41- if (( CURRENT == 2 )); then
42- # explain go commands
43- _values 'go tool commands' ${commands[@]}
44- return
45- fi
46- build_flags=(
47- '-a[force reinstallation of packages that are already up-to-date]'
48- '-n[print the commands but do not run them]'
49- "-p[number of parallel builds]:number"
50- '-x[print the commands]'
51- "-work[print temporary directory name and keep it]"
52- "-gcflags[flags for 5g/6g/8g]:flags"
53- "-ldflags[flags for 5l/6l/8l]:flags"
54- "-gccgoflags[flags for gccgo]:flags"
55- )
56- __go_list() {
57- local expl importpaths
58- declare -a importpaths
59- importpaths=($(go list ${words[$CURRENT]}... 2>/dev/null))
60- _wanted importpaths expl 'import paths' compadd "$@" - "${importpaths[@]}"
61- }
62- case ${words[2]} in
63- clean|doc)
64- _arguments -s -w : '*:importpaths:__go_list'
65- ;;
66- fix|fmt|list|vet)
67- _alternative ':importpaths:__go_list' ':files:_path_files -g "*.go"'
68- ;;
69- install)
70- _arguments -s -w : ${build_flags[@]} \
71- "-v[show package names]" \
72- '*:importpaths:__go_list'
73- ;;
74- get)
75- _arguments -s -w : \
76- ${build_flags[@]}
77- ;;
78- build)
79- _arguments -s -w : \
80- ${build_flags[@]} \
81- "-v[show package names]" \
82- "-o[output file]:file:_files" \
83- "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
84- ;;
85- test)
86- _arguments -s -w : \
87- ${build_flags[@]} \
88- "-c[do not run, compile the test binary]" \
89- "-i[do not run, install dependencies]" \
90- "-v[print test output]" \
91- "-x[print the commands]" \
92- "-short[use short mode]" \
93- "-parallel[number of parallel tests]:number" \
94- "-cpu[values of GOMAXPROCS to use]:number list" \
95- "-run[run tests and examples matching regexp]:regexp" \
96- "-bench[run benchmarks matching regexp]:regexp" \
97- "-benchtime[run each benchmark during n seconds]:duration" \
98- "-timeout[kill test after that duration]:duration" \
99- "-cpuprofile[write CPU profile to file]:file:_files" \
100- "-memprofile[write heap profile to file]:file:_files" \
101- "-memprofilerate[set heap profiling rate]:number" \
102- "*:args:{ _alternative ':importpaths:__go_list' ':files:_path_files -g \"*.go\"' }"
103- ;;
104- help)
105- _values "${commands[@]}" \
106diff --git a/plugins/go/go.plugin.zsh b/plugins/go/go.plugin.zsh
107new file mode 120000
108index 0000000000000000000000000000000000000000..cf943e2e1a98ae9f350f674a322b624e8ad7b1a4
109--- /dev/null
110+++ b/plugins/go/go.plugin.zsh
111@@ -0,0 +1 @@
112+../golang/golang.plugin.zsh
113diff --git a/plugins/golang/golang.plugin.zsh b/plugins/golang/golang.plugin.zsh
114index e60c4afe48e0b44cac537422229f8f32943a0349..18bcaaff284dc0e9dff48627826e09f461744682 100644
115--- a/plugins/golang/golang.plugin.zsh
116+++ b/plugins/golang/golang.plugin.zsh
117@@ -1,9 +1,10 @@
118-# From : http://golang.org/misc/zsh/go?m=text
119+# install in /etc/zsh/zshrc or your personal .zshrc
120+
121 # gc
122 prefixes=(5 6 8)
123 for p in $prefixes; do
124- compctl -g "*.${p}" ${p}l
125- compctl -g "*.go" ${p}g
126+ compctl -g "*.${p}" ${p}l
127+ compctl -g "*.go" ${p}g
128 done
129
130 # standard go tools
131@@ -19,6 +20,7 @@ __go_tool_complete() {
132 'build[compile packages and dependencies]'
133 'clean[remove object files]'
134 'doc[run godoc on package sources]'
135+ 'env[print Go environment information]'
136 'fix[run go tool fix on packages]'
137 'fmt[run gofmt on package sources]'
138 'get[download and install packages and dependencies]'
139@@ -39,12 +41,17 @@ __go_tool_complete() {
140 build_flags=(
141 '-a[force reinstallation of packages that are already up-to-date]'
142 '-n[print the commands but do not run them]'
143- "-p[number of parallel builds]:number"
144+ '-p[number of parallel builds]:number'
145+ '-race[enable data race detection]'
146 '-x[print the commands]'
147- "-work[print temporary directory name and keep it]"
148- "-gcflags[flags for 5g/6g/8g]:flags"
149- "-ldflags[flags for 5l/6l/8l]:flags"
150- "-gccgoflags[flags for gccgo]:flags"
151+ '-work[print temporary directory name and keep it]'
152+ '-ccflags[flags for 5c/6c/8c]:flags'
153+ '-gcflags[flags for 5g/6g/8g]:flags'
154+ '-ldflags[flags for 5l/6l/8l]:flags'
155+ '-gccgoflags[flags for gccgo]:flags'
156+ '-compiler[name of compiler to use]:name'
157+ '-installsuffix[suffix to add to package directory]:suffix'
158+ '-tags[list of build tags to consider satisfied]:tags'
159 )
160 __go_list() {
161 local expl importpaths
162@@ -62,7 +69,7 @@ __go_tool_complete() {
163 install)
164 _arguments -s -w : ${build_flags[@]} \
165 "-v[show package names]" \
166- '*:importpaths:__go_list'
167+ '*:importpaths:__go_list'
168 ;;
169 get)
170 _arguments -s -w : \
171@@ -87,7 +94,10 @@ __go_tool_complete() {
172 "-cpu[values of GOMAXPROCS to use]:number list" \
173 "-run[run tests and examples matching regexp]:regexp" \
174 "-bench[run benchmarks matching regexp]:regexp" \
175- "-benchtime[run each benchmark during n seconds]:duration" \
176+ "-benchmem[print memory allocation stats]" \
177+ "-benchtime[run each benchmark until taking this long]:duration" \
178+ "-blockprofile[write goroutine blocking profile to file]:file" \
179+ "-blockprofilerate[set sampling rate of goroutine blocking profile]:number" \
180 "-timeout[kill test after that duration]:duration" \
181 "-cpuprofile[write CPU profile to file]:file:_files" \
182 "-memprofile[write heap profile to file]:file:_files" \
183@@ -97,7 +107,7 @@ __go_tool_complete() {
184 help)
185 _values "${commands[@]}" \
186 'gopath[GOPATH environment variable]' \
187- 'importpath[description of import paths]' \
188+ 'packages[description of package lists]' \
189 'remote[remote import path syntax]' \
190 'testflag[description of testing flags]' \
191 'testfunc[description of testing functions]'
192@@ -147,4 +157,4 @@ __go_tool_complete() {
193 esac
194 }
195
196-compdef __go_tool_complete go
197+compdef __go_tool_complete go