Add a Data map[string]any field to store arbitrary data for a command.

This commit is contained in:
maxlandon 2023-12-04 08:30:39 +01:00
parent 3d8ac432bd
commit 03ef288abc
No known key found for this signature in database
GPG Key ID: 2DE5C14975A86900
1 changed files with 5 additions and 0 deletions

View File

@ -111,6 +111,11 @@ type Command struct {
// command does not define one.
Version string
// Data are key/value pairs of arbitrary types that can be used by applications or "plugin" libraries
// that wish to store and use data associated with a given command. This data will thus share the same
// lifetime as the command itself.
Data map[string]any
// The *Run functions are executed in the following order:
// * PersistentPreRun()
// * PreRun()