Skip to content

Give flags to manifests that shipped with flags: [] - #109

Merged
jonchun merged 1 commit into
mainfrom
fix/empty-flag-manifests
Aug 1, 2026
Merged

Give flags to manifests that shipped with flags: []#109
jonchun merged 1 commit into
mainfrom
fix/empty-flag-manifests

Conversation

@jonchun

@jonchun jonchun commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Why

Eleven of fifteen realistic invocations of the flags: [] manifests were rejected.
netstat -ano is the sharpest case — a first-reach Windows network diagnostic, explicitly
named on the Phase 4 list, refused because its manifest declared no flags at all.

This is the same defect found twice already: get-psdrive (fixed in #108) and now these.
An audit found 21 manifests with flags: [].

What changed

Fixed: netstat, tracert, get-volume, get-disk (Windows), and cat, who,
w, lscpu (POSIX).

Left alone deliberately: aws, docker, kubectl, svn, systemctl — their empty
lists are correct, because flags live on the subcommand manifests.

New field: allows_flag_bundling

netstat surfaced a conflation in the schema worth naming. shell: powershell currently
means both "runs on a Windows host" and "uses PowerShell parameter conventions" — but
netstat.exe and tracert.exe are native executables using DOS-style bundled switches,
where netstat -ano is -a -n -o.

Bundling was disabled for all powershell manifests so -Match wouldn't shred into
-M -a -t -c -h. That is right for cmdlets and wrong for native executables. This field
separates the two meanings, rather than enumerating combos (-ano, -an, -ao, …) —
the combinatorial explosion the original design explicitly rejected.

It is opt-in and defaults to false, so no existing manifest changes behavior.

Containment

TestFlagBundlingStaysOptIn is the guard that matters:

  • netstat -zzz → names -z (bundling active where opted in)
  • where-object -NotARealParameter → names the whole parameter
  • get-service -Nam → names the whole flag
  • get-volume -Bogus → names the whole flag

Testing

TestEmptyFlagListManifestsFixed, TestFlagBundlingStaysOptIn,
TestAllowsFlagBundlingParsed, TestAllowsFlagBundlingDefaultsFalse.

Full suite passes including -race; go vet clean.

Not verified

No real Windows host available, so these flag lists are from standard command
documentation and are not confirmed against live binaries. netstat, tracert, cat,
who, w, and lscpu are stable, long-documented interfaces; get-volume and
get-disk are the ones most worth a second look if a host becomes available.

🤖 Generated with Claude Code

Eleven of fifteen realistic invocations of the flags:[] manifests were
rejected. `netstat -ano` is the sharpest case: a first-reach Windows
network diagnostic, and explicitly on the Phase 4 list, refused because
its manifest declared no flags at all. Same defect already found twice
this week in get-psdrive and again here.

Fixed: netstat, tracert, get-volume, get-disk (Windows), and cat, who, w,
lscpu (POSIX). Left alone: aws, docker, kubectl, svn, systemctl, whose
empty lists are correct because flags live on their subcommand manifests.

Adds allows_flag_bundling, because netstat surfaced a conflation in the
schema. `shell: powershell` currently means both "runs on a Windows host"
and "uses PowerShell parameter conventions", but netstat.exe and
tracert.exe are native executables using DOS-style bundled switches -
`netstat -ano` is -a -n -o. Bundling was disabled for all powershell
manifests so `-Match` would not shred into -M -a -t -c -h, which is
right for cmdlets and wrong for these. The field separates the two
meanings rather than enumerating combos like -ano/-an/-ao, which is the
combinatorial explosion the design rejected.

Bundling stays opt-in and defaults to false, guarded by
TestFlagBundlingStaysOptIn: netstat -zzz names -z, while
where-object -NotARealParameter and get-volume -Bogus still name the
whole parameter.
@jonchun
jonchun merged commit 0026115 into main Aug 1, 2026
2 checks passed
@jonchun
jonchun deleted the fix/empty-flag-manifests branch August 1, 2026 14:21
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