• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

carapace-sh / carapace / 30114450443
61%

Build:
DEFAULT BRANCH: master
Ran 24 Jul 2026 05:49PM UTC
Jobs 1
Files 112
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

24 Jul 2026 05:48PM UTC coverage: 61.216% (+0.5%) from 60.7%
30114450443

push

github

web-flow
argumentstyle (#1227)

* pflagfork: handle Flag.ArgumentStyle to control accepted argument variants

Add ArgumentStyle() method and helper functions (acceptsNext, acceptsDelimited,
acceptsAttached) to check which argument styles a flag accepts. Update lookup
functions to respect these constraints when parsing flag arguments.

Also rename Mode() to GetMode() to avoid conflict with embedded pflag.Flag.Mode field.

Assisted-by: Crush:minimax-m2.7

* tmp

* example-nonposix: add argumentstyle subcommand and tests

Add subcommand to test each ArgumentStyle configuration:
- AcceptNext (1), AcceptDelimited (2), AcceptAttached (4)
- Combined styles like AcceptDelimited|AcceptNext
- Shorthand variants for each

Includes unit tests for pflag parsing behavior.

Assisted-by: Crush:minimax-m2.7

* fix test

* added test

* fix: handle ArgumentStyle restrictions for shorthand flags

- Export AcceptsNext/AcceptsDelimited/AcceptsAttached methods in pflagfork/flag.go
- Update flagset.go to use exported method names
- In traverse.go: don't complete attached argument when flag doesn't accept attached style
- In traverse.go: avoid ParseFlags error when shorthand lookup fails due to style restrictions
- Update argumentstyle_test.go nospace expectations to match actual behavior

Assisted-by: Crush:minimax-m2.7

* fix: gate flag-argument completion on AcceptsNext and clean up code

- Fix failing TestAcceptAttached: traverse.go now checks AcceptsNext()
  before completing a flag argument in the next-arg position, so flags
  with AcceptAttached-only style no longer incorrectly offer value
  completions when the user types `-3 <TAB>`.
- Replace magic numbers in internalActions.go with named pflagfork
  constants (NameAsShorthand, Default) via GetMode().
- Revert go.mod/example-nonposix go.mod local replace directives back
  to versioned carapace-pflag; keep local override in go.work only.
- Add named constants for ArgumentStyle bitmask values in pflagfork.
- Simplify lookupPos... (continued)

93 of 105 new or added lines in 6 files covered. (88.57%)

3905 of 6379 relevant lines covered (61.22%)

1.03 hits per line

Uncovered Changes

Lines Coverage ∆ File
4
90.91
example-nonposix/cmd/argumentstyle.go
4
91.1
-0.5% internal/pflagfork/flagset.go
3
60.75
4.83% internal/pflagfork/flag.go
1
0.0
0.0% internal/shell/export/snippet.go
Jobs
ID Job ID Ran Files Coverage
1 0 - 30114450443.1 24 Jul 2026 05:49PM UTC 112
61.22
GitHub Action Run
Source Files on build 30114450443
  • Tree
  • List 112
  • Changed 4
  • Source Changed 0
  • Coverage Changed 4
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 748aa9f9 on github
  • Prev Build on refs/tags/v1.13.3 (#29934134114)
  • Next Build on master (#30121448633)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc