Preserve reporting flag occurrence order
This commit is contained in:
@@ -91,15 +91,41 @@ type Failure struct {
|
||||
Usage bool
|
||||
}
|
||||
|
||||
// FlagOccurrence records one parsed spelling and its unconverted value.
|
||||
type FlagOccurrence struct {
|
||||
Name string // canonical flag name
|
||||
Spelling string // entered long spelling or individual short spelling
|
||||
RawValue string // unconverted value collected by the parser
|
||||
}
|
||||
|
||||
// ReportingMode selects visibility for shared reporting messages.
|
||||
type ReportingMode uint8
|
||||
|
||||
const (
|
||||
ReportingModeNormal ReportingMode = iota
|
||||
ReportingModeQuiet
|
||||
ReportingModeVerbose
|
||||
ReportingModeDebug
|
||||
)
|
||||
|
||||
// ReportingSelection contains the resolved reporting options for one parse.
|
||||
type ReportingSelection struct {
|
||||
Mode ReportingMode
|
||||
Progress bool
|
||||
ProgressSet bool
|
||||
}
|
||||
|
||||
// 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
|
||||
Operands []string
|
||||
Failure *Failure
|
||||
Key Key
|
||||
Path []string
|
||||
HelpRequested bool
|
||||
FlagValues [][]string
|
||||
FlagSpellings [][]string
|
||||
FlagOccurrences []FlagOccurrence
|
||||
Reporting ReportingSelection
|
||||
Operands []string
|
||||
Failure *Failure
|
||||
}
|
||||
|
||||
// ParseOptions makes parser context and streams explicit.
|
||||
|
||||
Reference in New Issue
Block a user