summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-09-17 07:02:52 -0400
committerGitHub <noreply@github.com>2021-09-17 07:02:52 -0400
commit9a5987cf6a7729f9d03a663dd361a37ca473da59 (patch)
tree447677216c3a88bef777cd6a452252a0314f17a7 /cmd
parentc6ae5c7961e2663ba91de7877aafe9791a80b245 (diff)
parent4216f7b7f492fee80cfc9a7f1deb608096edd890 (diff)
downloadpodman-9a5987cf6a7729f9d03a663dd361a37ca473da59.tar.gz
podman-9a5987cf6a7729f9d03a663dd361a37ca473da59.tar.bz2
podman-9a5987cf6a7729f9d03a663dd361a37ca473da59.zip
Merge pull request #11603 from rhatdan/truncate
Add no-trunc support to podman-events
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/containers/mount.go3
-rw-r--r--cmd/podman/images/history.go3
-rw-r--r--cmd/podman/system/events.go5
-rw-r--r--cmd/podman/utils/alias.go2
4 files changed, 10 insertions, 3 deletions
diff --git a/cmd/podman/containers/mount.go b/cmd/podman/containers/mount.go
index 55f6a1c34..0397b456f 100644
--- a/cmd/podman/containers/mount.go
+++ b/cmd/podman/containers/mount.go
@@ -62,7 +62,8 @@ func mountFlags(cmd *cobra.Command) {
flags.StringVar(&mountOpts.Format, formatFlagName, "", "Print the mounted containers in specified format (json)")
_ = cmd.RegisterFlagCompletionFunc(formatFlagName, common.AutocompleteFormat(nil))
- flags.BoolVar(&mountOpts.NoTruncate, "notruncate", false, "Do not truncate output")
+ flags.BoolVar(&mountOpts.NoTruncate, "no-trunc", false, "Do not truncate output")
+ flags.SetNormalizeFunc(utils.AliasFlags)
}
func init() {
diff --git a/cmd/podman/images/history.go b/cmd/podman/images/history.go
index c065acfad..cc7b1b4eb 100644
--- a/cmd/podman/images/history.go
+++ b/cmd/podman/images/history.go
@@ -11,6 +11,7 @@ import (
"github.com/containers/common/pkg/report"
"github.com/containers/podman/v3/cmd/podman/common"
"github.com/containers/podman/v3/cmd/podman/registry"
+ "github.com/containers/podman/v3/cmd/podman/utils"
"github.com/containers/podman/v3/pkg/domain/entities"
"github.com/docker/go-units"
"github.com/pkg/errors"
@@ -73,8 +74,8 @@ func historyFlags(cmd *cobra.Command) {
flags.BoolVarP(&opts.human, "human", "H", true, "Display sizes and dates in human readable format")
flags.BoolVar(&opts.noTrunc, "no-trunc", false, "Do not truncate the output")
- flags.BoolVar(&opts.noTrunc, "notruncate", false, "Do not truncate the output")
flags.BoolVarP(&opts.quiet, "quiet", "q", false, "Display the numeric IDs only")
+ flags.SetNormalizeFunc(utils.AliasFlags)
}
func history(cmd *cobra.Command, args []string) error {
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))
}
}
diff --git a/cmd/podman/utils/alias.go b/cmd/podman/utils/alias.go
index 306e610d9..4d5b625d0 100644
--- a/cmd/podman/utils/alias.go
+++ b/cmd/podman/utils/alias.go
@@ -23,6 +23,8 @@ func AliasFlags(f *pflag.FlagSet, name string) pflag.NormalizedName {
name = "external"
case "purge":
name = "rm"
+ case "notruncate":
+ name = "no-trunc"
case "override-arch":
name = "arch"
case "override-os":