{"record":{"id":"cfea26e90e8fcc16","repo":"SubtitleEdit/subtitleedit","slug":"unknown-rulekind-rule-id-run-seconv-listc","errorCode":null,"errorMessage":"Unknown {ruleKind} rule '{id}'. Run 'seconv {listCommand}' to see available IDs.","messagePattern":"Unknown (.+?) rule '(.+?)'\\. Run 'seconv (.+?)' to see available IDs\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/seconv/Core/RuleIdSpec.cs","lineNumber":75,"sourceCode":"            if (id.Equals(\"all\", StringComparison.OrdinalIgnoreCase))\n            {\n                if (negate)\n                {\n                    selected.Clear();\n                }\n                else\n                {\n                    foreach (var a in availableIds)\n                    {\n                        selected.Add(a);\n                    }\n                }\n                continue;\n            }\n\n            if (!available.Contains(id))\n            {\n                throw new ArgumentException(\n                    $\"Unknown {ruleKind} rule '{id}'. Run 'seconv {listCommand}' to see available IDs.\");\n            }\n\n            if (negate)\n            {\n                selected.Remove(id);\n            }\n            else\n            {\n                selected.Add(id);\n            }\n        }\n\n        return availableIds.Where(selected.Contains).ToArray();\n    }\n}\n","sourceCodeStart":57,"sourceCodeEnd":92,"githubUrl":"https://github.com/SubtitleEdit/subtitleedit/blob/17a9f0748781032255db3526b7215d2fb891e3af/src/seconv/Core/RuleIdSpec.cs#L57-L92","documentation":"Thrown by RuleIdSpec.Resolve when a token in the `--fix-common-errors-rules` or `--remove-formatting-rules` spec is not 'all' and not in the canonical availableIds set for that rule family. Matching is case-insensitive but exact-string, so misspellings, deprecated names, or IDs from the wrong family all fail. ArgumentException signals a bad option value rather than a runtime fault.","triggerScenarios":"Calling `RuleIdSpec.Resolve(spec, availableIds, ruleKind, listCommand)` where `spec` contains an ID like 'FixComas' (typo of 'FixCommas') or a name from the remove-formatting family used in a fix-common-errors spec. Available IDs depend on which rule family the call passes.","commonSituations":"Typoing a rule ID; using a GUI display name instead of the canonical ID; stale ID from an older seconv release; mixing up the two rule families; copy-paste from a forum post with a renamed rule.","solutions":["Run the listed command (`seconv list-fce-rules` or `seconv list-rf-rules`) to print the exact valid IDs.","Copy the ID verbatim from that output into your --...-rules value.","Use 'all' or 'all,-<id>' to avoid enumerating IDs you are unsure of.","Confirm you are using IDs from the correct family for the flag."],"exampleFix":"# before\nseconv in.srt out.srt --fix-common-errors-rules=FixComas,FixHyphens\n# after\nseconv list-fce-rules   # copy exact ID 'FixCommas'\nseconv in.srt out.srt --fix-common-errors-rules=FixCommas,FixHyphens","handlingStrategy":"validation","validationCode":"var available = new HashSet<string>(availableIds, StringComparer.OrdinalIgnoreCase);\nforeach (var tok in spec.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))\n{\n    var id = tok.TrimStart('-');\n    if (id.Equals(\"all\", StringComparison.OrdinalIgnoreCase)) continue;\n    if (!available.Contains(id)) throw new ArgumentException(\"Unknown rule id: \" + id);\n}","typeGuard":"static bool AreRuleIdsValid(string? spec, IReadOnlyList<string> available)\n{\n    if (string.IsNullOrWhiteSpace(spec)) return true;\n    var set = new HashSet<string>(available, StringComparer.OrdinalIgnoreCase);\n    foreach (var tok in spec.Split(',', StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))\n    {\n        var id = tok.TrimStart('-');\n        if (id.Equals(\"all\", StringComparison.OrdinalIgnoreCase)) continue;\n        if (!set.Contains(id)) return false;\n    }\n    return true;\n}","tryCatchPattern":"try { var ids = RuleIdSpec.Resolve(spec, availableIds, kind, cmd); }\ncatch (ArgumentException ex) when (ex.Message.Contains(\"Unknown\"))\n{\n    // run the list command, surface valid IDs, reprompt\n}","preventionTips":["Run the matching `seconv list-*-rules` command and pass IDs verbatim.","Prefer 'all,-<id>' over enumerating IDs you are unsure of.","Add a CI test asserting every documented ID resolves."],"tags":["cli","rules","enum-validation","configuration"],"backgroundTag":null,"analyzedSha":"17a9f0748781032255db3526b7215d2fb891e3af","analyzedAt":"2026-08-13T18:11:43.374Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}