Skip to content

feat(complete): complete sigil-prefixed positionals - #1319

Open
jdx wants to merge 9 commits into
feat/spec-sigil-argsfrom
feat/complete-sigil-args
Open

feat(complete): complete sigil-prefixed positionals#1319
jdx wants to merge 9 commits into
feat/spec-sigil-argsfrom
feat/complete-sigil-args

Conversation

@jdx

@jdx jdx commented Aug 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • match completions against the value after the declared sigil
  • restore the sigil on emitted completion candidates
  • keep explicit double dash behavior intact
  • add dedicated sigil documentation and completion examples

Stack

Test plan

  • cargo test -p usage-cli complete_word_sigil
  • cargo test -p usage-conformance --test sigil
  • mise run lint

AI-assisted — Tool: Codex; model: OpenAI/GPT-5; version: unavailable.


Note

Low Risk
Changes are confined to completion paths with new tests; parsing behavior is assumed from the dependent stack (#1322), not modified here.

Overview
Adds shell completion for sigil arguments (arg sigil="+" and similar): tokens like +n are treated as the declared positional after stripping the prefix, then candidates are emitted with the sigil restored (+node@22, etc.).

Both usage-argv (complete.rs) and the CLI reference (complete_word) share the same rules: longest matching sigil wins, flag values and explicit -- / restart boundaries / double_dash="automatic" stop sigil classification, and cwd file fallback is suppressed while completing a sigil-shaped word (including dynamic run= completers that see the stripped words[CURRENT]).

Documentation adds a sigils reference page, a sigil.usage.kdl example, and tests cover choices, separators, restart tokens, overlays, and runtime completers.

Reviewed by Cursor Bugbot for commit 895f5f3. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 25, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 23e2313b-52a8-43c0-b8f7-98857a09ed0a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Comment thread argv/src/complete.rs Outdated
Comment thread argv/src/complete.rs Outdated
@jdx
jdx force-pushed the feat/complete-sigil-args branch from 5110a33 to bcfbb7d Compare August 25, 2026 17:41
Comment thread argv/src/complete.rs
@jdx
jdx force-pushed the feat/complete-sigil-args branch from bcfbb7d to 25838cc Compare August 25, 2026 17:53
Comment thread cli/src/cli/complete_word.rs
@jdx
jdx force-pushed the feat/complete-sigil-args branch from 25838cc to e469a24 Compare August 25, 2026 17:59
Comment thread argv/src/complete.rs
@jdx
jdx force-pushed the feat/complete-sigil-args branch 2 times, most recently from 5609fce to 9b1f823 Compare August 25, 2026 18:17
Comment thread cli/src/cli/complete_word.rs
@jdx
jdx force-pushed the feat/complete-sigil-args branch from 683bbed to ace249e Compare August 25, 2026 18:32
Comment thread argv/src/complete.rs
@github-actions

github-actions Bot commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
markdown ▅▁▁▄▅▁▁██ 338,970,876 → 339,060,552 +0.03% 30.04 → 29.71ms -1.10%
startup ▂▂▂▆▆▆▆█▁ 911,202 → 907,830 -0.37% 0.91 → 0.94ms +2.71%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

Shadow comparison

Parsing mise use -g node@20 against a shadow of mise's committed spec.
Reported, not gated: the shadow grows as the derive learns to express more, so
what to watch is the ratio rather than either column.

framework stripped binary, bytes
usage 1328960
bpaf 2493280
clap 3101832
framework instructions, cold parse vs usage
usage 8477
clap 6315570 745x
bpaf 21909031 2584x
                                              min       p01       p10    median
usage-rs: argv -> struct                      419       423       426       440  ns
clap: build tree + parse -> struct         526025    526588    529664    549417  ns
bpaf: build parser + parse -> struct      1581456   1581456   1591780   1607436  ns

usage: argv -> struct                             422 ns      0.42 µs
clap: build tree + parse -> struct             532204 ns    532.20 µs
clap: parse -> struct, tree reused              23474 ns     23.47 µs
clap: build tree only                          324053 ns    324.05 µs

895f5f3cf949 vs 5c9ddcf0fac0 · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the feat/complete-sigil-args branch 5 times, most recently from 6f6f260 to 5c3c3a1 Compare August 25, 2026 21:12
@jdx
jdx force-pushed the feat/complete-sigil-args branch from 5c3c3a1 to c92343c Compare August 27, 2026 12:50

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit c92343c. Configure here.

Comment thread cli/src/cli/complete_word.rs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant