Parse invocation flags across command discovery

This commit is contained in:
2026-11-22 20:53:25 +00:00
parent ea3ce25001
commit b6cb183a71
10 changed files with 136 additions and 30 deletions

View File

@@ -16,9 +16,10 @@ type Command struct {
Runnable bool
Flags []Flag
// CoreFlags are parsed by CommandKit but do not occupy consumer binding indexes.
CoreFlags []Flag
Arguments []Argument
Children []*Command
CoreFlags []Flag
InvocationFlags []Flag
Arguments []Argument
Children []*Command
}
// Argument describes one positional input for usage rendering.
@@ -196,15 +197,17 @@ type ReportingSelection struct {
// Result contains the selected command and raw input collected by the adapter.
type Result struct {
Key Key
Path []string
HelpRequested bool
FlagValues [][]string
FlagSpellings [][]string
FlagOccurrences []FlagOccurrence
Reporting ReportingSelection
Operands []string
Failure *Failure
Key Key
Path []string
HelpRequested bool
FlagValues [][]string
FlagSpellings [][]string
InvocationFlagValues [][]string
InvocationFlagSpellings [][]string
FlagOccurrences []FlagOccurrence
Reporting ReportingSelection
Operands []string
Failure *Failure
}
// ParseOptions selects flag aliases for parser contexts.