From 03ef288abc54ec0c1b871e51820b877ce4725ecc Mon Sep 17 00:00:00 2001 From: maxlandon Date: Mon, 4 Dec 2023 08:30:39 +0100 Subject: [PATCH] Add a Data map[string]any field to store arbitrary data for a command. --- command.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/command.go b/command.go index 11a3e9c99..9c8a05454 100644 --- a/command.go +++ b/command.go @@ -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()