Skip to content

Flags after "--" are silently swallowed by noun-canonicalization arg scanner (indexNextPositional) #159

Description

@BlueLabelscotch

Summary

Arguments passed after the -- terminator are supposed to be treated as raw, untouched positional args (standard pflag/cobra behavior). Instead, pkg/registry/flag.go's indexNextPositional —
used by IndexVerbNoun/CanonicalizeNounArgs to locate/rewrite the noun token before cobra ever parses flags — does not special-case "--" as a terminator, and its "unknown flag consumes next
token as value" heuristic can eat the very next token after -- if it looks like an unrecognized flag.

Repro

harness execute artifact:pip_install -- -r requirements.txt

Expected: pip install -r requirements.txt is run (via nativeArgs forwarded to pipClient.RunCommand).

Actual: pip receives only requirements.txt as a bare positional arg — -r is dropped — producing:
ERROR: Could not find a version that satisfies the requirement requirements.txt

Confirmed via debug trace that args arriving at RunCommand in pkgmgr_pip.go is []string{"requirements.txt"}, i.e. -r is already gone before it reaches command execution.

Metadata

Metadata

Labels

harHAR Module Plugin

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions