From 4216f7b7f492fee80cfc9a7f1deb608096edd890 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Thu, 16 Sep 2021 05:41:09 -0400 Subject: Add no-trunc support to podman-events Standardize on no-trunc through the code. Alias notruncate where necessary. Standardize on the man page display of no-trunc. Fixes: https://github.com/containers/podman/issues/8941 Signed-off-by: Daniel J Walsh --- cmd/podman/system/events.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'cmd/podman/system/events.go') diff --git a/cmd/podman/system/events.go b/cmd/podman/system/events.go index 677504cfc..e698e6652 100644 --- a/cmd/podman/system/events.go +++ b/cmd/podman/system/events.go @@ -36,6 +36,7 @@ var ( var ( eventOptions entities.EventsOptions eventFormat string + noTrunc bool ) func init() { @@ -58,6 +59,8 @@ func init() { flags.StringVar(&eventOptions.Since, sinceFlagName, "", "show all events created since timestamp") _ = eventsCommand.RegisterFlagCompletionFunc(sinceFlagName, completion.AutocompleteNone) + flags.BoolVar(&noTrunc, "no-trunc", true, "do not truncate the output") + untilFlagName := "until" flags.StringVar(&eventOptions.Until, untilFlagName, "", "show all events until timestamp") _ = eventsCommand.RegisterFlagCompletionFunc(untilFlagName, completion.AutocompleteNone) @@ -110,7 +113,7 @@ func eventsCmd(cmd *cobra.Command, _ []string) error { } fmt.Println("") default: - fmt.Println(event.ToHumanReadable()) + fmt.Println(event.ToHumanReadable(!noTrunc)) } } -- cgit v1.2.3-54-g00ecf