Skip to content

Commit 05d1dce

Browse files
Document "go install" without explicit version. (#461)
Also remove the "<definition-file>" variant from the documentation as that does not seem to work. Fixes #457
1 parent 7b1546c commit 05d1dce

3 files changed

Lines changed: 37 additions & 20 deletions

File tree

plugins/go-build/bin/goenv-install

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
#
33
# Summary: Install a Go version using go-build
44
#
5-
# Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
6-
# goenv install [-f] [-kvpq] <definition-file>
5+
# Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
76
# goenv install -l|--list
87
# goenv install --version
98
#
109
# -l/--list List all available versions
1110
# -f/--force Install even if the version appears to be installed already
1211
# -s/--skip-existing Skip if the version appears to be installed already
1312
#
13+
# If no version is specified, `goenv local` will be used to determine the
14+
# desired version.
15+
#
1416
# go-build options:
1517
#
1618
# -k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation

plugins/go-build/test/goenv-install.bats

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ export PATH="${project_root}/libexec:$PATH"
88
@test "has usage instructions" {
99
run goenv-help --usage install
1010
assert_success_out <<OUT
11-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
12-
goenv install [-f] [-kvpq] <definition-file>
11+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
1312
goenv install -l|--list
1413
goenv install --version
1514
OUT
@@ -39,15 +38,17 @@ OUT
3938
@test "prints full usage when '-h' is first argument given" {
4039
run goenv-install -h
4140
assert_success_out <<'OUT'
42-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
43-
goenv install [-f] [-kvpq] <definition-file>
41+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
4442
goenv install -l|--list
4543
goenv install --version
4644
4745
-l/--list List all available versions
4846
-f/--force Install even if the version appears to be installed already
4947
-s/--skip-existing Skip if the version appears to be installed already
5048
49+
If no version is specified, `goenv local` will be used to determine the
50+
desired version.
51+
5152
go-build options:
5253
5354
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation
@@ -67,15 +68,17 @@ OUT
6768
@test "prints full usage when '--help' is first argument given" {
6869
run goenv-install --help
6970
assert_success_out <<'OUT'
70-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
71-
goenv install [-f] [-kvpq] <definition-file>
71+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
7272
goenv install -l|--list
7373
goenv install --version
7474
7575
-l/--list List all available versions
7676
-f/--force Install even if the version appears to be installed already
7777
-s/--skip-existing Skip if the version appears to be installed already
7878
79+
If no version is specified, `goenv local` will be used to determine the
80+
desired version.
81+
7982
go-build options:
8083
8184
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation
@@ -95,15 +98,17 @@ OUT
9598
@test "fails and prints full usage when no arguments are given" {
9699
run goenv-install
97100
assert_failure_out <<'OUT'
98-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
99-
goenv install [-f] [-kvpq] <definition-file>
101+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
100102
goenv install -l|--list
101103
goenv install --version
102104
103105
-l/--list List all available versions
104106
-f/--force Install even if the version appears to be installed already
105107
-s/--skip-existing Skip if the version appears to be installed already
106108
109+
If no version is specified, `goenv local` will be used to determine the
110+
desired version.
111+
107112
go-build options:
108113
109114
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation
@@ -123,15 +128,17 @@ OUT
123128
@test "fails and prints full usage when '-f' is given and no other arguments" {
124129
run goenv-install -f
125130
assert_failure_out <<'OUT'
126-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
127-
goenv install [-f] [-kvpq] <definition-file>
131+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
128132
goenv install -l|--list
129133
goenv install --version
130134
131135
-l/--list List all available versions
132136
-f/--force Install even if the version appears to be installed already
133137
-s/--skip-existing Skip if the version appears to be installed already
134138
139+
If no version is specified, `goenv local` will be used to determine the
140+
desired version.
141+
135142
go-build options:
136143
137144
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation
@@ -151,15 +158,17 @@ OUT
151158
@test "fails and prints full usage when '--force' is given and no other arguments" {
152159
run goenv-install --force
153160
assert_failure_out <<'OUT'
154-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
155-
goenv install [-f] [-kvpq] <definition-file>
161+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
156162
goenv install -l|--list
157163
goenv install --version
158164
159165
-l/--list List all available versions
160166
-f/--force Install even if the version appears to be installed already
161167
-s/--skip-existing Skip if the version appears to be installed already
162168
169+
If no version is specified, `goenv local` will be used to determine the
170+
desired version.
171+
163172
go-build options:
164173
165174
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation
@@ -179,15 +188,17 @@ OUT
179188
@test "fails and prints full usage when '-f' is given and '-' version argument" {
180189
run goenv-install -f -
181190
assert_failure_out <<'OUT'
182-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
183-
goenv install [-f] [-kvpq] <definition-file>
191+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
184192
goenv install -l|--list
185193
goenv install --version
186194
187195
-l/--list List all available versions
188196
-f/--force Install even if the version appears to be installed already
189197
-s/--skip-existing Skip if the version appears to be installed already
190198
199+
If no version is specified, `goenv local` will be used to determine the
200+
desired version.
201+
191202
go-build options:
192203
193204
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation
@@ -207,15 +218,17 @@ OUT
207218
@test "fails and prints full usage when '--force' is given and '-' version argument" {
208219
run goenv-install --force
209220
assert_failure_out <<'OUT'
210-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
211-
goenv install [-f] [-kvpq] <definition-file>
221+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
212222
goenv install -l|--list
213223
goenv install --version
214224
215225
-l/--list List all available versions
216226
-f/--force Install even if the version appears to be installed already
217227
-s/--skip-existing Skip if the version appears to be installed already
218228
229+
If no version is specified, `goenv local` will be used to determine the
230+
desired version.
231+
219232
go-build options:
220233
221234
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation

test/goenv.bats

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,15 +78,17 @@ OUT
7878
unset GOENV_AUTO_INSTALL
7979

8080
assert_failure_out <<'OUT'
81-
Usage: goenv install [-f] [-kvpq] <version>|latest|unstable
82-
goenv install [-f] [-kvpq] <definition-file>
81+
Usage: goenv install [-f] [-s] [-kvpq] [<version>|latest|unstable]
8382
goenv install -l|--list
8483
goenv install --version
8584
8685
-l/--list List all available versions
8786
-f/--force Install even if the version appears to be installed already
8887
-s/--skip-existing Skip if the version appears to be installed already
8988
89+
If no version is specified, `goenv local` will be used to determine the
90+
desired version.
91+
9092
go-build options:
9193
9294
-k/--keep Keep source tree in $GOENV_BUILD_ROOT after installation

0 commit comments

Comments
 (0)