Skip to content

Commit 4a439ce

Browse files
committed
Rename header-process to header-command
1 parent bccc2d6 commit 4a439ce

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed

cli/root.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ const (
5656
varAgentToken = "agent-token"
5757
varAgentURL = "agent-url"
5858
varHeader = "header"
59-
varHeaderProcess = "header-process"
59+
varHeaderCommand = "header-command"
6060
varNoOpen = "no-open"
6161
varNoVersionCheck = "no-version-warning"
6262
varNoFeatureWarning = "no-feature-warning"
@@ -359,10 +359,10 @@ func (r *RootCmd) Command(subcommands []*clibase.Cmd) (*clibase.Cmd, error) {
359359
Group: globalGroup,
360360
},
361361
{
362-
Flag: varHeaderProcess,
363-
Env: "CODER_HEADER_PROCESS",
362+
Flag: varHeaderCommand,
363+
Env: "CODER_HEADER_COMMAND",
364364
Description: "An external process that outputs JSON-encoded key-value pairs to be used as additional HTTP headers added to all requests.",
365-
Value: clibase.StringOf(&r.headerProcess),
365+
Value: clibase.StringOf(&r.headerCommand),
366366
Group: globalGroup,
367367
},
368368
{
@@ -446,7 +446,7 @@ type RootCmd struct {
446446
token string
447447
globalConfig string
448448
header []string
449-
headerProcess string
449+
headerCommand string
450450
agentToken string
451451
agentURL *url.URL
452452
forceTTY bool
@@ -612,15 +612,15 @@ func (r *RootCmd) setClient(ctx context.Context, client *codersdk.Client, server
612612
}
613613
transport.header.Add(parts[0], parts[1])
614614
}
615-
if r.headerProcess != "" {
615+
if r.headerCommand != "" {
616616
shell := "sh"
617617
caller := "-c"
618618
if runtime.GOOS == "windows" {
619619
shell = "cmd.exe"
620620
caller = "/c"
621621
}
622622
// #nosec
623-
cmd := exec.CommandContext(ctx, shell, caller, r.headerProcess)
623+
cmd := exec.CommandContext(ctx, shell, caller, r.headerCommand)
624624
cmd.Env = append(os.Environ(), "CODER_URL="+serverURL.String())
625625
out, err := cmd.Output()
626626
if err != nil {

cli/root_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestRoot(t *testing.T) {
9494
"--no-version-warning",
9595
"--header", "X-Testing=wow",
9696
"--header", "Cool-Header=Dean was Here!",
97-
"--header-process", "printf '{\"X-Process-Testing\": \"very-wow-'"+coderURLEnv+"'\"}'",
97+
"--header-command", "printf '{\"X-Process-Testing\": \"very-wow-'"+coderURLEnv+"'\"}'",
9898
"login", srv.URL,
9999
)
100100
inv.Stdout = buf
@@ -107,7 +107,7 @@ func TestRoot(t *testing.T) {
107107
}
108108

109109
// TestDERPHeaders ensures that the client sends the global `--header`s and
110-
// `--header-process` to the DERP server when connecting.
110+
// `--header-command` to the DERP server when connecting.
111111
func TestDERPHeaders(t *testing.T) {
112112
t.Parallel()
113113

@@ -169,7 +169,7 @@ func TestDERPHeaders(t *testing.T) {
169169
"--no-version-warning",
170170
"ping", workspace.Name,
171171
"-n", "1",
172-
"--header-process", "printf '{\"X-Process-Testing\": \"very-wow\"}'",
172+
"--header-command", "printf '{\"X-Process-Testing\": \"very-wow\"}'",
173173
}
174174
for k, v := range expectedHeaders {
175175
if k != "X-Process-Testing" {

cli/testdata/coder_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ variables or flags.
6262
Additional HTTP headers added to all requests. Provide as key=value.
6363
Can be specified multiple times.
6464

65-
--header-process string, $CODER_HEADER_PROCESS
66-
An external process that outputs JSON-encoded key-value pairs to be
65+
--header-command string, $CODER_HEADER_COMMAND
66+
An external command that outputs JSON-encoded key-value pairs to be
6767
used as additional HTTP headers added to all requests.
6868

6969
--no-feature-warning bool, $CODER_NO_FEATURE_WARNING

docs/cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,14 +96,14 @@ Path to the global `coder` config directory.
9696

9797
Additional HTTP headers added to all requests. Provide as key=value. Can be specified multiple times.
9898

99-
### --header-process
99+
### --header-command
100100

101101
| | |
102102
| ----------- | ---------------------------------- |
103103
| Type | <code>string</code> |
104-
| Environment | <code>$CODER_HEADER_PROCESS</code> |
104+
| Environment | <code>$CODER_HEADER_COMMAND</code> |
105105

106-
An external process that outputs JSON-encoded key-value pairs to be used as additional HTTP headers added to all requests.
106+
An external command that outputs JSON-encoded key-value pairs to be used as additional HTTP headers added to all requests.
107107

108108
### --no-feature-warning
109109

enterprise/cli/testdata/coder_--help.golden

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ variables or flags.
3333
Additional HTTP headers added to all requests. Provide as key=value.
3434
Can be specified multiple times.
3535

36-
--header-process string, $CODER_HEADER_PROCESS
37-
An external process that outputs JSON-encoded key-value pairs to be
36+
--header-command string, $CODER_HEADER_COMMAND
37+
An external command that outputs JSON-encoded key-value pairs to be
3838
used as additional HTTP headers added to all requests.
3939

4040
--no-feature-warning bool, $CODER_NO_FEATURE_WARNING

0 commit comments

Comments
 (0)