{"record":{"id":"24a94582c561949e","repo":"helix-editor/helix","slug":"unexpected-short-arg","errorCode":null,"errorMessage":"unexpected short arg {}","messagePattern":"unexpected short arg (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"helix-term/src/args.rs","lineNumber":104,"sourceCode":"                                \"--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                    };\n                }\n                arg => insert_file_with_position(arg),\n            }\n        }\n\n        // push the remaining args, if any to the files\n        for arg in argv {\n            insert_file_with_position(&arg);\n        }","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/helix-editor/helix/blob/079a789e8cb08ead67f19e1971a1b7438b37354b/helix-term/src/args.rs#L86-L122","documentation":"helix-term's CLI parser (Args::parse_args in args.rs) accepts only three clusterable short flags: 'v' (verbosity, repeatable), 'V' (print version), 'h' (help). Every character after a single dash is matched individually; any character outside {v, V, h} bails immediately and startup aborts. Value-taking flags like -g/-c/-w have their own match arms and are not part of the cluster loop.","triggerScenarios":"Running `hx -t`, `hx -x file.rs`, or a mixed cluster like `hx -vq`. Also single-dash misspellings of long options: `hx -config x.toml` fails on 'c', `hx -tutor` fails on 't', `hx -help` fails on 'e'.","commonSituations":"Vim/emacs muscle memory (flags like -t, -e, -R that helix does not have); wrapper scripts written for a different helix version after flags were added/renamed; typos in shell aliases.","solutions":["Replace the short flag with the documented long form: --tutor, --strict, --health [LANG], -g/--grammar fetch|build, -c/--config <path>, --log <path>, -w/--working-dir <dir>, --vsplit, --hsplit.","If the cluster itself was a typo (e.g. -vq), drop the invalid characters and keep only v/V/h (e.g. -vv).","Run `hx --help` to confirm the exact flag set of the installed version.","Re-test wrapper scripts and aliases after every helix upgrade."],"exampleFix":"# before: fails on 't'\nhx -vt main.rs\n# after\nhx -vv --tutor main.rs","handlingStrategy":"validation","validationCode":"# shell wrapper: reject short flags outside {v,V,h} before launching\nfor a in \"$@\"; do\n  case \"$a\" in\n    -[!vVh-]*) echo \"unsupported short flag: $a\" >&2; exit 2 ;;\n  esac\ndone\nexec hx \"$@\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use long flags (--tutor, --config, ...) in scripts and aliases; they fail with clearer messages.","Re-run `hx --help` after upgrades; the clusterable short-flag set is intentionally only v/V/h."],"tags":["cli","arguments","startup"],"backgroundTag":null,"analyzedSha":"079a789e8cb08ead67f19e1971a1b7438b37354b","analyzedAt":"2026-08-16T09:09:59.668Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}