You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: internal/flags/flags.go
+92Lines changed: 92 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ import (
6
6
"os"
7
7
"path/filepath"
8
8
"strconv"
9
+
"strings"
9
10
"time"
10
11
11
12
"github.com/fatih/color"
@@ -86,7 +87,11 @@ var (
86
87
CACertstring
87
88
Certstring
88
89
CertKeystring
90
+
RemoteHeaders []string
89
91
Interactivebool
92
+
93
+
// Store the config for access in WithFlags()
94
+
taskrcConfig*taskrcast.TaskRC
90
95
)
91
96
92
97
funcinit() {
@@ -109,6 +114,7 @@ func init() {
109
114
dir=cmp.Or(dir, filepath.Dir(entrypoint))
110
115
111
116
config, _:=taskrc.GetConfig(dir)
117
+
taskrcConfig=config
112
118
experiments.ParseWithConfig(dir, config)
113
119
114
120
// Parse the rest of the flags
@@ -174,6 +180,7 @@ func init() {
174
180
pflag.StringVar(&CACert, "cacert", getConfig(config, "REMOTE_CACERT", func() *string { returnconfig.Remote.CACert }, ""), "Path to a custom CA certificate for HTTPS connections.")
175
181
pflag.StringVar(&Cert, "cert", getConfig(config, "REMOTE_CERT", func() *string { returnconfig.Remote.Cert }, ""), "Path to a client certificate for HTTPS connections.")
176
182
pflag.StringVar(&CertKey, "cert-key", getConfig(config, "REMOTE_CERT_KEY", func() *string { returnconfig.Remote.CertKey }, ""), "Path to a client certificate key for HTTPS connections.")
183
+
pflag.StringSliceVar(&RemoteHeaders, "header", nil, "HTTP header for remote requests in format 'host:Header-Name=value' (can be repeated).")
177
184
}
178
185
pflag.Parse()
179
186
@@ -247,6 +254,13 @@ func Validate() error {
247
254
returnerrors.New("task: --cert and --cert-key must be provided together")
0 commit comments