(arg string)
| 288 | } |
| 289 | |
| 290 | func (flag *headerFlags) Set(arg string) error { |
| 291 | index := strings.Index(arg, ":") |
| 292 | if index < 0 { |
| 293 | return fmt.Errorf(`Invalid header (%s). Should be in the format "HeaderName: HeaderContent"`, arg) |
| 294 | } |
| 295 | if flag.Header == nil { |
| 296 | flag.Header = http.Header{} |
| 297 | } |
| 298 | key := arg[0:index] |
| 299 | value := arg[index+1:] |
| 300 | flag.Header.Set(key, strings.TrimSpace(value)) |
| 301 | return nil |
| 302 | } |
| 303 | |
| 304 | var clientHelp = ` |
| 305 | Usage: chisel client [options] <server> <remote> [remote] [remote] ... |