From e9a5590add67803babcc059446d23bc0dacb8d02 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Wed, 20 Dec 2023 16:17:21 +0100 Subject: [PATCH] cli/command/container: statsOptions: add GoDoc Signed-off-by: Sebastiaan van Stijn --- cli/command/container/stats.go | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/cli/command/container/stats.go b/cli/command/container/stats.go index 1d240cf44e..5c8ee84e93 100644 --- a/cli/command/container/stats.go +++ b/cli/command/container/stats.go @@ -21,11 +21,26 @@ import ( "github.com/spf13/cobra" ) +// statsOptions defines options for runStats. type statsOptions struct { - all bool - noStream bool - noTrunc bool - format string + // all allows including both running and stopped containers. The default + // is to only include running containers. + all bool + + // noStream disables streaming stats. If enabled, stats are collected once, + // and the result is printed. + noStream bool + + // noTrunc disables truncating the output. The default is to truncate + // output such as container-IDs. + noTrunc bool + + // format is a custom template to use for presenting the stats. + // Refer to [flagsHelper.FormatHelp] for accepted formats. + format string + + // containers is the list of container names or IDs to include in the stats. + // If empty, all containers are included. containers []string }