Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0d58df9

Browse files
committed
docs + fixes
1 parenta4ea942 commit0d58df9

File tree

58 files changed

+316
-267
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+316
-267
lines changed

‎cli/cliui/output_test.go

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,11 @@ func Test_OutputFormatter(t *testing.T) {
106106

107107
fs:=cmd.Options.FlagSet()
108108

109-
selected,err:=fs.GetString("output")
110-
require.NoError(t,err)
111-
require.Equal(t,"json",selected)
109+
selected:=cmd.Options.ByFlag("output")
110+
require.NotNil(t,selected)
111+
require.Equal(t,"json",selected.Value.String())
112112
usage:=fs.FlagUsages()
113-
require.Contains(t,usage,"Available formats: json, foo")
113+
require.Contains(t,usage,"Output format.")
114114
require.Contains(t,usage,"foo flag 1234")
115115

116116
ctx:=context.Background()
@@ -129,11 +129,10 @@ func Test_OutputFormatter(t *testing.T) {
129129
require.Equal(t,"foo",out)
130130
require.EqualValues(t,1,atomic.LoadInt64(&called))
131131

132-
require.NoError(t,fs.Set("output","bar"))
132+
require.Error(t,fs.Set("output","bar"))
133133
out,err=f.Format(ctx,data)
134-
require.Error(t,err)
135-
require.ErrorContains(t,err,"bar")
136-
require.Equal(t,"",out)
137-
require.EqualValues(t,1,atomic.LoadInt64(&called))
134+
require.NoError(t,err)
135+
require.Equal(t,"foo",out)
136+
require.EqualValues(t,2,atomic.LoadInt64(&called))
138137
})
139138
}

‎cli/completion.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@ func (*RootCmd) completion() *serpent.Command {
2626
Flag:"print",
2727
Description:"Print the completion script instead of installing it.",
2828
FlagShorthand:"p",
29-
Value:serpent.BoolOf(&printOutput),
29+
30+
Value:serpent.BoolOf(&printOutput),
3031
},
3132
},
3233
Handler:func(inv*serpent.Invocation)error {

‎cli/organizationmembers_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestListOrganizationMembers(t *testing.T) {
2323
client,user:=coderdtest.CreateAnotherUser(t,ownerClient,owner.OrganizationID,rbac.RoleUserAdmin())
2424

2525
ctx:=testutil.Context(t,testutil.WaitMedium)
26-
inv,root:=clitest.New(t,"organization","members","list","-c","user_id,username,roles")
26+
inv,root:=clitest.New(t,"organization","members","list","-c","user_id,username,organization_roles")
2727
clitest.SetupConfig(t,client,root)
2828

2929
buf:=new(bytes.Buffer)

‎cli/templateedit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
func (r*RootCmd)templateEdit()*serpent.Command {
1818
constdeprecatedFlagName="deprecated"
19-
vardaysOfWeekEnum= []string{"monday","tuesday","wednesday","thursday","friday","saturday","sunday","all"}
19+
daysOfWeekEnum:= []string{"monday","tuesday","wednesday","thursday","friday","saturday","sunday","all"}
2020
var (
2121
namestring
2222
displayNamestring

‎cli/testdata/coder_--help.golden

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ USAGE:
1515

1616
SUBCOMMANDS:
1717
autoupdate Toggle auto-update policy for a workspace
18+
completion Install or update shell completion scripts for the
19+
detected shell.
1820
config-ssh Add an SSH Host entry for your workspaces "ssh
1921
coder.workspace"
2022
create Create a workspace
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
coder v0.0.0-devel
2+
3+
USAGE:
4+
coder completion [flags]
5+
6+
Install or update shell completion scripts for the detected shell.
7+
8+
OPTIONS:
9+
-p, --print bool
10+
Print the completion script instead of installing it.
11+
12+
-s, --shell bash|fish|zsh|powershell
13+
The shell to install completion for.
14+
15+
———
16+
Run `coder --help` for a list of global options.

‎cli/testdata/coder_list_--help.golden

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,11 @@ OPTIONS:
1111
-a, --all bool
1212
Specifies whether all workspaces will be listed or not.
1313

14-
-c, --column string-array (default: workspace,template,status,healthy,last built,current version,outdated,starts at,stops after)
15-
Columns to display in table output. Available columns: favorite,
16-
workspace, organization id, organization name, template, status,
17-
healthy, last built, current version, outdated, starts at, starts
18-
next, stops after, stops next, daily cost.
19-
20-
-o, --output string (default: table)
21-
Output format. Available formats: table, json.
14+
-c, --column [favorite|workspace|organization id|organization name|template|status|healthy|last built|current version|outdated|starts at|starts next|stops after|stops next|daily cost] (default: workspace,template,status,healthy,last built,current version,outdated,starts at,stops after)
15+
Columns to display in table output.
16+
17+
-o, --output table|json (default: table)
18+
Output format.
2219

2320
--search string (default: owner:me)
2421
Search for a workspace with a query.

‎cli/testdata/coder_schedule_show_--help.golden

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ OPTIONS:
1515
-a, --all bool
1616
Specifies whether all workspaces will be listed or not.
1717

18-
-c, --column string-array (default: workspace,starts at,starts next,stops after,stops next)
19-
Columns to display in table output. Available columns: workspace,
20-
starts at, starts next, stops after, stops next.
18+
-c, --column [workspace|starts at|starts next|stops after|stops next] (default: workspace,starts at,starts next,stops after,stops next)
19+
Columns to display in table output.
2120

22-
-o, --outputstring (default: table)
23-
Output format. Available formats: table, json.
21+
-o, --outputtable|json (default: table)
22+
Output format.
2423

2524
--search string (default: owner:me)
2625
Search for a workspace with a query.

‎cli/testdata/coder_speedtest_--help.golden

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ USAGE:
66
Run upload and download tests from your machine to a workspace
77

88
OPTIONS:
9-
-c, --column string-array (default: Interval,Throughput)
10-
Columns to display in table output. Available columns: Interval,
11-
Throughput.
9+
-c, --column [Interval|Throughput] (default: Interval,Throughput)
10+
Columns to display in table output.
1211

1312
-d, --direct bool
1413
Specifies whether to wait for a direct connection before testing
@@ -18,8 +17,8 @@ OPTIONS:
1817
Specifies whether to run in reverse mode where the client receives and
1918
the server sends.
2019

21-
-o, --outputstring (default: table)
22-
Output format. Available formats: table, json.
20+
-o, --outputtable|json (default: table)
21+
Output format.
2322

2423
--pcap-file string
2524
Specifies a file to write a network capture to.

‎cli/testdata/coder_stat_--help.golden

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ SUBCOMMANDS:
1111
mem Show memory usage, in gigabytes.
1212

1313
OPTIONS:
14-
-c, --column string-array (default: host_cpu,host_memory,home_disk,container_cpu,container_memory)
15-
Columns to display in table output. Available columns: host cpu, host
16-
memory, home disk, container cpu, container memory.
14+
-c, --column [host cpu|host memory|home disk|container cpu|container memory] (default: host_cpu,host_memory,home_disk,container_cpu,container_memory)
15+
Columns to display in table output.
1716

18-
-o, --outputstring (default: table)
19-
Output format. Available formats: table, json.
17+
-o, --outputtable|json (default: table)
18+
Output format.
2019

2120
———
2221
Run `coder --help` for a list of global options.

‎cli/testdata/coder_stat_cpu_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ OPTIONS:
99
--host bool
1010
Force host CPU measurement.
1111

12-
-o, --outputstring (default: text)
13-
Output format. Available formats: text, json.
12+
-o, --outputtext|json (default: text)
13+
Output format.
1414

1515
———
1616
Run `coder --help` for a list of global options.

‎cli/testdata/coder_stat_disk_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ USAGE:
66
Show disk usage, in gigabytes.
77

88
OPTIONS:
9-
-o, --outputstring (default: text)
10-
Output format. Available formats: text, json.
9+
-o, --outputtext|json (default: text)
10+
Output format.
1111

1212
--path string (default: /)
1313
Path for which to check disk usage.

‎cli/testdata/coder_stat_mem_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ OPTIONS:
99
--host bool
1010
Force host memory measurement.
1111

12-
-o, --outputstring (default: text)
13-
Output format. Available formats: text, json.
12+
-o, --outputtext|json (default: text)
13+
Output format.
1414

1515
--prefix Ki|Mi|Gi|Ti (default: Gi)
1616
SI Prefix for memory measurement.

‎cli/testdata/coder_templates_edit_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ OPTIONS:
2525
--allow-user-cancel-workspace-jobs bool (default: true)
2626
Allow users to cancel in-progress workspace jobs.
2727

28-
--autostart-requirement-weekdaysstring-array
28+
--autostart-requirement-weekdays[monday|tuesday|wednesday|thursday|friday|saturday|sunday|all|all]
2929
Edit the template autostart requirement weekdays - workspaces created
3030
from this template can only autostart on the given weekdays. To unset
3131
this value for the template (and allow autostart on all days), pass
3232
'all'.
3333

34-
--autostop-requirement-weekdaysstring-array
34+
--autostop-requirement-weekdays[monday|tuesday|wednesday|thursday|friday|saturday|sunday|all|none]
3535
Edit the template autostop requirement weekdays - workspaces created
3636
from this template must be restarted on the given weekdays. To unset
3737
this value for the template (and disable the autostop requirement for

‎cli/testdata/coder_templates_list_--help.golden

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,11 @@ USAGE:
88
Aliases: ls
99

1010
OPTIONS:
11-
-c, --column string-array (default: name,organization name,last updated,used by)
12-
Columns to display in table output. Available columns: name, created
13-
at, last updated, organization id, organization name, provisioner,
14-
active version id, used by, default ttl.
11+
-c, --column [name|created at|last updated|organization id|organization name|provisioner|active version id|used by|default ttl] (default: name,organization name,last updated,used by)
12+
Columns to display in table output.
1513

16-
-o, --outputstring (default: table)
17-
Output format. Available formats: table, json.
14+
-o, --outputtable|json (default: table)
15+
Output format.
1816

1917
———
2018
Run `coder --help` for a list of global options.

‎cli/testdata/coder_templates_versions_list_--help.golden

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@ OPTIONS:
99
-O, --org string, $CODER_ORGANIZATION
1010
Select which organization (uuid or name) to use.
1111

12-
-c, --column string-array (default: Name,Created At,Created By,Status,Active)
13-
Columns to display in table output. Available columns: name, created
14-
at, created by, status, active, archived.
12+
-c, --column [name|created at|created by|status|active|archived] (default: Name,Created At,Created By,Status,Active)
13+
Columns to display in table output.
1514

1615
--include-archived bool
1716
Include archived versions in the result list.
1817

19-
-o, --outputstring (default: table)
20-
Output format. Available formats: table, json.
18+
-o, --outputtable|json (default: table)
19+
Output format.
2120

2221
———
2322
Run `coder --help` for a list of global options.

‎cli/testdata/coder_tokens_list_--help.golden

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,11 @@ OPTIONS:
1212
Specifies whether all users' tokens will be listed or not (must have
1313
Owner role to see all tokens).
1414

15-
-c, --column string-array (default: id,name,last used,expires at,created at)
16-
Columns to display in table output. Available columns: id, name, last
17-
used, expires at, created at, owner.
15+
-c, --column [id|name|last used|expires at|created at|owner] (default: id,name,last used,expires at,created at)
16+
Columns to display in table output.
1817

19-
-o, --outputstring (default: table)
20-
Output format. Available formats: table, json.
18+
-o, --outputtable|json (default: table)
19+
Output format.
2120

2221
———
2322
Run `coder --help` for a list of global options.

‎cli/testdata/coder_users_activate_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ USAGE:
1111
$ coder users activate example_user
1212

1313
OPTIONS:
14-
-c, --columnstring-array (default: username,email,created_at,status)
14+
-c, --column[username|email|created_at|status] (default: username,email,created_at,status)
1515
Specify a column to filter in the table.
1616

1717
———

‎cli/testdata/coder_users_list_--help.golden

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,11 @@ USAGE:
66
Aliases: ls
77

88
OPTIONS:
9-
-c, --column string-array (default: username,email,created_at,status)
10-
Columns to display in table output. Available columns: id, username,
11-
email, created at, updated at, status.
9+
-c, --column [id|username|email|created at|updated at|status] (default: username,email,created_at,status)
10+
Columns to display in table output.
1211

13-
-o, --outputstring (default: table)
14-
Output format. Available formats: table, json.
12+
-o, --outputtable|json (default: table)
13+
Output format.
1514

1615
———
1716
Run `coder --help` for a list of global options.

‎cli/testdata/coder_users_show_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ USAGE:
88
$ coder users show me
99

1010
OPTIONS:
11-
-o, --outputstring (default: table)
12-
Output format. Available formats: table, json.
11+
-o, --outputtable|json (default: table)
12+
Output format.
1313

1414
———
1515
Run `coder --help` for a list of global options.

‎cli/testdata/coder_users_suspend_--help.golden

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ USAGE:
99
$ coder users suspend example_user
1010

1111
OPTIONS:
12-
-c, --columnstring-array (default: username,email,created_at,status)
12+
-c, --column[username|email|created_at|status] (default: username,email,created_at,status)
1313
Specify a column to filter in the table.
1414

1515
———

‎cli/testdata/coder_version_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ USAGE:
66
Show coder version
77

88
OPTIONS:
9-
-o, --outputstring (default: text)
10-
Output format. Available formats: text, json.
9+
-o, --outputtext|json (default: text)
10+
Output format.
1111

1212
———
1313
Run `coder --help` for a list of global options.

‎docs/cli.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ Coder — A tool for provisioning self-hosted development environments with Terr
2525

2626
| Name| Purpose|
2727
| ------------------------------------------------------| -----------------------------------------------------------------------------------------------------|
28+
|[<code>completion</code>](./cli/completion.md)| Install or update shell completion scripts for the detected shell.|
2829
|[<code>dotfiles</code>](./cli/dotfiles.md)| Personalize your workspace by applying a canonical dotfiles repository|
2930
|[<code>external-auth</code>](./cli/external-auth.md)| Manage external authentication|
3031
|[<code>login</code>](./cli/login.md)| Authenticate with Coder deployment|

‎docs/cli/completion.md

Lines changed: 29 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎docs/cli/config-ssh.md

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎docs/cli/features_list.md

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp