{"record":{"id":"61521ab4203e2a0a","repo":"helix-editor/helix","slug":"unexpected-double-dash-argument","errorCode":null,"errorMessage":"unexpected double dash argument: {}","messagePattern":"unexpected double dash argument: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helix-term/src/args.rs","lineNumber":95,"sourceCode":"                    Some(path) => args.log_file = Some(path.into()),\n                    None => anyhow::bail!(\"--log must specify a path to write\"),\n                },\n                \"-w\" | \"--working-dir\" => match argv.next().as_deref() {\n                    Some(path) => {\n                        args.working_directory = if Path::new(path).is_dir() {\n                            Some(PathBuf::from(path))\n                        } else {\n                            anyhow::bail!(\n                                \"--working-dir specified does not exist or is not a directory\"\n                            )\n                        }\n                    }\n                    None => {\n                        anyhow::bail!(\"--working-dir must specify an initial working directory\")\n                    }\n                },\n                arg if arg.starts_with(\"--\") => {\n                    anyhow::bail!(\"unexpected double dash argument: {}\", arg)\n                }\n                arg if arg.starts_with('-') => {\n                    let arg = arg.get(1..).unwrap().chars();\n                    for chr in arg {\n                        match chr {\n                            'v' => args.verbosity += 1,\n                            'V' => args.display_version = true,\n                            'h' => args.display_help = true,\n                            _ => anyhow::bail!(\"unexpected short arg {}\", chr),\n                        }\n                    }\n                }\n                \"+\" => line_number = usize::MAX,\n                arg if arg.starts_with('+') => {\n                    match arg[1..].parse::<usize>() {\n                        Ok(n) => line_number = n.saturating_sub(1),\n                        _ => insert_file_with_position(arg),\n                    };","sourceCodeStart":77,"sourceCodeEnd":113,"githubUrl":"https://github.com/helix-editor/helix/blob/079a789e8cb08ead67f19e1971a1b7438b37354b/helix-term/src/args.rs#L77-L113","documentation":"Catch-all for any unrecognized long option: after all known '--' flags are matched, any argument starting with '--' that is not '--' itself (the literal separator) bails with 'unexpected double dash argument: <arg>'. This is Helix's unknown-option error, deliberately distinguishing long flags from the short-flag cluster handling that follows.","triggerScenarios":"'hx --nushell', 'hx --vs-split', 'hx --file a.txt' - any typo'd or unsupported long flag. Note everything after a bare '--' is treated as filenames and never reaches this arm.","commonSituations":"Flags from other editors' muscle memory (--wait, --new-window, --diff); typos (--vplits); flags removed or renamed across Helix versions; scripts written against clap-style flag sets that don't exist here.","solutions":["Check 'hx --help' for the supported long options and correct the flag","Use the '--' separator if the token is actually a FILE whose name starts with '--': hx -- --weird-filename","Update scripts after Helix upgrades - flags occasionally move (e.g. grammar/log/config/working-dir all take values)"],"exampleFix":"# before\nhx --wait file.rs\n\n# after\nhx file.rs\nhx -- --strange-file-name   # to open a file starting with --","handlingStrategy":"validation","validationCode":"# Script guard: verify long flags against the known set before exec\nknown='--version --help --strict --tutor --vsplit --hsplit --health --grammar --config --log --working-dir --'\nfor a in \"$@\"; do\n  case \" $known \" in\n    *\" $a \"*) ;;\n    --*) echo \"unknown flag: $a\" >&2; hx --help >&2; exit 2;;\n  esac\ndone\nexec hx \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Consult 'hx --help' before using a long flag - muscle memory from other tools misleads","Use '--' to pass filenames that start with '--'","Re-check flag names after upgrading Helix; prefer the short forms (-v -V -h) where available"],"tags":["rust","helix","cli","args","usage"],"backgroundTag":null,"analyzedSha":"079a789e8cb08ead67f19e1971a1b7438b37354b","analyzedAt":"2026-08-16T09:09:59.668Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}