{"id":"232fcff43eb5c47e","repo":"docker/cli","slug":"specify-only-one-h-232fcf","errorCode":null,"errorMessage":"specify only one -H","messagePattern":"specify only one -H","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/flags/options.go","lineNumber":81,"sourceCode":"// slice. It produces an error when trying to set multiple values, matching\n// the check in [getServerHost].\n//\n// [getServerHost]: https://github.com/docker/cli/blob/7eab668982645def1cd46fe1b60894cba6fd17a4/cli/command/cli.go#L542-L551\ntype hostVar struct {\n\tdst *[]string\n\tset bool\n}\n\nfunc (h *hostVar) String() string {\n\tif h.dst == nil || len(*h.dst) == 0 {\n\t\treturn \"\"\n\t}\n\treturn (*h.dst)[0]\n}\n\nfunc (h *hostVar) Set(s string) error {\n\tif h.set {\n\t\treturn errors.New(\"specify only one -H\")\n\t}\n\t*h.dst = []string{s}\n\th.set = true\n\treturn nil\n}\n\nfunc (*hostVar) Type() string { return \"string\" }\n\n// ClientOptions are the options used to configure the client cli.\ntype ClientOptions struct {\n\tDebug      bool\n\tHosts      []string\n\tLogLevel   string\n\tTLS        bool\n\tTLSVerify  bool\n\tTLSOptions *tlsconfig.Options\n\tContext    string\n\tConfigDir  string","sourceCodeStart":63,"sourceCodeEnd":99,"githubUrl":"https://github.com/docker/cli/blob/e9452d6e785f6e365712b9d71bd7517591773c86/cli/flags/options.go#L63-L99","documentation":"Error \"specify only one -H\" thrown in docker/cli.","triggerScenarios":"Thrown at cli/flags/options.go:81 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}