{"record":{"id":"0ef62955b9f6933d","repo":"ipfs/kubo","slug":"no-matching-options-given","errorCode":null,"errorMessage":"no matching options given","messagePattern":"no matching options given","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/p2p.go","lineNumber":533,"sourceCode":"\n\t\tvar target, listen ma.Multiaddr\n\n\t\tif l {\n\t\t\tlisten, err = ma.NewMultiaddr(listenOpt)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif t {\n\t\t\ttarget, err = ma.NewMultiaddr(targetOpt)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tif !(closeAll || p || l || t) {\n\t\t\treturn errors.New(\"no matching options given\")\n\t\t}\n\n\t\tif closeAll && (p || l || t) {\n\t\t\treturn errors.New(\"can't combine --all with other matching options\")\n\t\t}\n\n\t\tmatch := func(listener p2p.Listener) bool {\n\t\t\tif closeAll {\n\t\t\t\treturn true\n\t\t\t}\n\t\t\tif p && proto != listener.Protocol() {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif l && !listen.Equal(listener.ListenAddress()) {\n\t\t\t\treturn false\n\t\t\t}\n\t\t\tif t && !target.Equal(listener.TargetAddress()) {\n\t\t\t\treturn false","sourceCodeStart":515,"sourceCodeEnd":551,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/p2p.go#L515-L551","documentation":"`ipfs p2p close` requires the user to say what to close. The command checks that at least one selector was given: --all, or a protocol (-p), listen address (-l), or target (-t) filter. If none is present it returns this error rather than guessing.","triggerScenarios":"Running `ipfs p2p close` with no arguments and none of the --all / --protocol / --listen / --target options; also invalid: combining --all with any of the other selectors (separate error, same call site block).","commonSituations":"Typing `ipfs p2p close` expecting it to close everything without --all; forgetting that protocol filters need `-p <proto>`; scripts that drop empty optional arguments leaving no selector at all.","solutions":["Close everything with `ipfs p2p close --all`.","Close a specific tunnel by selector, e.g. `ipfs p2p close -p /p2p/myapp/1.0.0`, `-l <listen-addr>`, or `-t <target>`.","Fix scripts that pass empty selector variables so at least one selector (or --all) is always present."],"exampleFix":"// before\nipfs p2p close\n// after\nipfs p2p close --all        # or: ipfs p2p close -p /p2p/myapp/1.0.0","handlingStrategy":"validation","validationCode":"if !closeAll && proto == \"\" && listen == \"\" && target == \"\" {\n    return errors.New(\"specify --all or one of -p/-l/-t for 'ipfs p2p close'\")\n}\nif closeAll && (proto != \"\" || listen != \"\" || target != \"\") {\n    return errors.New(\"--all cannot be combined with -p/-l/-t\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default wrapper scripts to `ipfs p2p close --all` when no selector is supplied.","Skip empty optional arguments so at least one selector always reaches the command.","Never combine --all with -p/-l/-t; branch explicitly in scripts."],"tags":["p2p","cli","validation"],"backgroundTag":"missing-required-option","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"}