mirror of
https://github.com/golang/go.git
synced 2025-05-15 20:34:38 +00:00
misc/bash, misc/zsh: fix completion rules
This patch includes fixes pointed out in CL 52140043, which was originally written by john.gosset. LGTM=minux.ma R=golang-codereviews, minux.ma CC=golang-codereviews https://golang.org/cl/80320043
This commit is contained in:
parent
fc6befba3c
commit
6119dc1b52
12
misc/bash/go
12
misc/bash/go
@ -22,8 +22,7 @@ _go()
|
|||||||
|
|
||||||
local cmds="build clean env fix fmt get
|
local cmds="build clean env fix fmt get
|
||||||
install list run test tool version vet"
|
install list run test tool version vet"
|
||||||
local addhelp="gopath importpath remote
|
local addhelp="c gopath importpath packages testflag testfunc"
|
||||||
testflag testfunc"
|
|
||||||
local other="help"
|
local other="help"
|
||||||
|
|
||||||
if [ "$COMP_CWORD" == 1 ]; then
|
if [ "$COMP_CWORD" == 1 ]; then
|
||||||
@ -185,15 +184,9 @@ _go()
|
|||||||
'dist') # TODO: Implement something.
|
'dist') # TODO: Implement something.
|
||||||
#_go_tool_dist
|
#_go_tool_dist
|
||||||
;;
|
;;
|
||||||
'ebnflint') # TODO: Implement something.
|
|
||||||
#_go_tool_ebnflint
|
|
||||||
;;
|
|
||||||
'fix') # TODO: Implement something.
|
'fix') # TODO: Implement something.
|
||||||
#_go_tool_fix
|
#_go_tool_fix
|
||||||
;;
|
;;
|
||||||
'gotype') # TODO: Implement something.
|
|
||||||
#_go_tool_gotype
|
|
||||||
;;
|
|
||||||
'nm') # TODO: Implement something.
|
'nm') # TODO: Implement something.
|
||||||
#_go_tool_nm
|
#_go_tool_nm
|
||||||
;;
|
;;
|
||||||
@ -203,9 +196,6 @@ _go()
|
|||||||
'pprof') # TODO: Implement something.
|
'pprof') # TODO: Implement something.
|
||||||
#_go_tool_pprof
|
#_go_tool_pprof
|
||||||
;;
|
;;
|
||||||
'prof') # TODO: Implement something.
|
|
||||||
#_go_tool_prof
|
|
||||||
;;
|
|
||||||
'vet') # TODO: Implement something.
|
'vet') # TODO: Implement something.
|
||||||
#_go_tool_vet
|
#_go_tool_vet
|
||||||
;;
|
;;
|
||||||
|
@ -19,7 +19,6 @@ __go_tool_complete() {
|
|||||||
commands+=(
|
commands+=(
|
||||||
'build[compile packages and dependencies]'
|
'build[compile packages and dependencies]'
|
||||||
'clean[remove object files]'
|
'clean[remove object files]'
|
||||||
'doc[run godoc on package sources]'
|
|
||||||
'env[print Go environment information]'
|
'env[print Go environment information]'
|
||||||
'fix[run go tool fix on packages]'
|
'fix[run go tool fix on packages]'
|
||||||
'fmt[run gofmt on package sources]'
|
'fmt[run gofmt on package sources]'
|
||||||
@ -92,6 +91,7 @@ __go_tool_complete() {
|
|||||||
"-short[use short mode]" \
|
"-short[use short mode]" \
|
||||||
"-parallel[number of parallel tests]:number" \
|
"-parallel[number of parallel tests]:number" \
|
||||||
"-cpu[values of GOMAXPROCS to use]:number list" \
|
"-cpu[values of GOMAXPROCS to use]:number list" \
|
||||||
|
"-cover[enable coverage analysis]" \
|
||||||
"-run[run tests and examples matching regexp]:regexp" \
|
"-run[run tests and examples matching regexp]:regexp" \
|
||||||
"-bench[run benchmarks matching regexp]:regexp" \
|
"-bench[run benchmarks matching regexp]:regexp" \
|
||||||
"-benchmem[print memory allocation stats]" \
|
"-benchmem[print memory allocation stats]" \
|
||||||
@ -106,9 +106,10 @@ __go_tool_complete() {
|
|||||||
;;
|
;;
|
||||||
help)
|
help)
|
||||||
_values "${commands[@]}" \
|
_values "${commands[@]}" \
|
||||||
|
'c[how to call C code]' \
|
||||||
|
'importpath[description of import path]' \
|
||||||
'gopath[GOPATH environment variable]' \
|
'gopath[GOPATH environment variable]' \
|
||||||
'packages[description of package lists]' \
|
'packages[description of package lists]' \
|
||||||
'remote[remote import path syntax]' \
|
|
||||||
'testflag[description of testing flags]' \
|
'testflag[description of testing flags]' \
|
||||||
'testfunc[description of testing functions]'
|
'testfunc[description of testing functions]'
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user