{"record":{"id":"329455cf48bb1fab","repo":"pola-rs/polars","slug":"unknown-argument-unknown","errorCode":null,"errorMessage":"unknown argument: `{unknown}`","messagePattern":"unknown argument: `(.+?)`","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-plan/src/bin/dsl-schema.rs","lineNumber":52,"sourceCode":"    use std::path::Path;\n\n    use polars_plan::dsl::DslPlan;\n    use schemars::Schema;\n    use sha2::Digest;\n\n    const DEFAULT_HASHES_PATH: &str = \"crates/polars-plan/dsl-schema-hashes.json\";\n\n    pub fn run() {\n        let mut args = std::env::args();\n\n        let _ = args.next();\n        let cmd = args\n            .next()\n            .expect(\"missing command [generate, update-hashes, check-hashes]\");\n        let path = args.next();\n\n        if let Some(unknown) = args.next() {\n            panic!(\"unknown argument: `{unknown}`\");\n        }\n\n        match cmd.as_str() {\n            \"generate\" => {\n                generate(path.unwrap_or(\"./dsl-schema.json\".to_owned()));\n            },\n            \"update-hashes\" => {\n                update_hashes(path.unwrap_or(DEFAULT_HASHES_PATH.to_owned()));\n            },\n            \"check-hashes\" => {\n                check_hashes(path.unwrap_or(DEFAULT_HASHES_PATH.to_owned()));\n            },\n            unknown => {\n                panic!(\"unknown command: `{unknown}`\");\n            },\n        }\n    }\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-plan/src/bin/dsl-schema.rs#L34-L70","documentation":"The binary accepts exactly two CLI arguments: the subcommand and an optional path. Any third (or later) argument reaches this check and triggers `panic!(\"unknown argument: `{unknown}`\")`. This strictness prevents silently ignoring typo'd or leftover flags.","triggerScenarios":"Calling the binary with more than two positional arguments, e.g. `dsl-schema generate out.json extra`, or passing flags like `--force` which the binary does not parse.","commonSituations":"Adding flags habitually (`--verbose`, `--output`) that this minimal CLI does not support; shell scripts appending extra variables that expand into extra positional args.","solutions":["Remove the extra arguments; only `<command> [path]` is accepted.","If you intended a flag, check the binary's source — no flags are parsed, only two positionals.","Quote paths with spaces as a single argument so they don't split into multiple args."],"exampleFix":"// before\ndsl-schema generate ./out.json --pretty\n\n// after\ndsl-schema generate ./out.json","handlingStrategy":"validation","validationCode":"# shellcheck\ncmd=\"$1\"; path=\"$2\"; shift 2 || true\nif [ \"$#\" -gt 0 ]; then echo \"extra args not allowed\" >&2; exit 1; fi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pass only `<command> [path]` — no flags are supported.","Quote paths containing spaces so they count as a single argument.","Review scripts for variables that may expand into extra positional args."],"tags":["cli","panic","invalid-argument"],"backgroundTag":"invalid-cli-argument","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}