Document and validate automatic usage reporting
This commit is contained in:
@@ -15,6 +15,13 @@ type InvocationFeature struct{ record *invocationFeatureRecord }
|
||||
// NewInput creates fresh input for each invocation; nil uses the zero value.
|
||||
// Start receives the current invocation and may return a replacement context
|
||||
// and a function producing a report at invocation finalization. Start is required.
|
||||
// Features start in installation traversal order after command input construction
|
||||
// and successful CheckInput; each receives the context returned by its predecessor.
|
||||
// A nil context leaves it unchanged and a nil report function produces no report.
|
||||
// Report functions run once after deferred messages and before terminal explanations,
|
||||
// even after a returned failure or cancellation. Reports render as text on
|
||||
// diagnostics, with quiet suppressing delivery. Generated help, version and
|
||||
// completion, and preflight failures do not start features.
|
||||
type InvocationFeatureSpec[I any] struct {
|
||||
NewInput func() I
|
||||
Flags []Flag[I]
|
||||
|
||||
Reference in New Issue
Block a user