{"record":{"id":"ba5d47ede7a4dc71","repo":"ipfs/kubo","slug":"format-was-set-by-multiple-options-only-one-forma","errorCode":null,"errorMessage":"format was set by multiple options. Only one format option is allowed","messagePattern":"format was set by multiple options\\. Only one format option is allowed","errorType":"validation","errorClass":"errFormat","httpStatus":null,"severity":"error","filePath":"core/commands/files.go","lineNumber":165,"sourceCode":"\t\t\"flush\":  filesFlushCmd,\n\t\t\"chcid\":  filesChcidCmd,\n\t\t\"chmod\":  filesChmodCmd,\n\t\t\"chroot\": filesChrootCmd,\n\t\t\"touch\":  filesTouchCmd,\n\t},\n}\n\nconst (\n\tfilesCidVersionOptionName = \"cid-version\"\n\tfilesHashOptionName       = \"hash\"\n)\n\nvar (\n\tcidVersionOption = cmds.IntOption(filesCidVersionOptionName, \"cid-ver\", \"Cid version to use. (experimental)\")\n\thashOption       = cmds.StringOption(filesHashOptionName, \"Hash function to use. Will set Cid version to 1 if used. (experimental)\")\n)\n\nvar errFormat = errors.New(\"format was set by multiple options. Only one format option is allowed\")\n\ntype statOutput struct {\n\tHash           string\n\tSize           uint64\n\tCumulativeSize uint64\n\tBlocks         int\n\tType           string\n\tWithLocality   bool   `json:\",omitempty\"`\n\tLocal          bool   `json:\",omitempty\"`\n\tSizeLocal      uint64 `json:\",omitempty\"`\n\tMode           uint32 `json:\",omitempty\"`\n\tMtime          int64  `json:\",omitempty\"`\n\tMtimeNsecs     int    `json:\",omitempty\"`\n}\n\nfunc (s *statOutput) MarshalJSON() ([]byte, error) {\n\ttype so statOutput\n\tout := &struct {","sourceCodeStart":147,"sourceCodeEnd":183,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/files.go#L147-L183","documentation":"Sentinel errFormat from 'ipfs files stat': more than one output-shaping option (--format, --size/--hash shorthand flags) was supplied at once. The formatting choice is ambiguous, so the command refuses instead of picking a winner; exactly one format option is allowed.","triggerScenarios":"Thrown at core/commands/files.go:165 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass only one of --format, --hash, or --size","Build the desired layout with a single --format template string"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}