Parse quoted arguments in alias expansions #90
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/alias-quoted-args"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Alias expansions were tokenized with `split_whitespace`, so a quoted argument was torn apart. After `fj alias set bug 'issue create --label "needs triage"'`, running `fj bug` handed clap the tokens `--label`, `"needs`, `triage"`, so the label became `"needs` instead of `needs triage`. `gh` parses alias expansions shell-style; this brings `fj` in line.
Tokenize the expansion with `shlex` (already present in the dependency tree at 1.3.0, the advisory-fixed release; only `split` is used, never the flagged `quote`). Malformed quoting falls back to whitespace splitting so a broken alias degrades to the old behaviour rather than vanishing. Tests cover quoted, plain, and malformed expansions.