summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-01-12 20:12:19 +0100
committerGitHub <noreply@github.com>2022-01-12 20:12:19 +0100
commit3f0661639c3ef3b18e4437f00075352df0af6cee (patch)
treefd2e33452247373b176f70ff2ab6c5f503527d92 /cmd
parentf69fcb24832780a9cc4fd17818967374fcb0710f (diff)
parentfde6ad637355ee27929da084e2920ef2b730875c (diff)
downloadpodman-3f0661639c3ef3b18e4437f00075352df0af6cee.tar.gz
podman-3f0661639c3ef3b18e4437f00075352df0af6cee.tar.bz2
podman-3f0661639c3ef3b18e4437f00075352df0af6cee.zip
Merge pull request #12151 from rhatdan/noout
Add --noout option to prevent the output of ids
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/root.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmd/podman/root.go b/cmd/podman/root.go
index b695443c2..1de937ca5 100644
--- a/cmd/podman/root.go
+++ b/cmd/podman/root.go
@@ -114,6 +114,10 @@ func persistentPreRunE(cmd *cobra.Command, args []string) error {
}
cfg := registry.PodmanConfig()
+ if cfg.NoOut {
+ null, _ := os.Open(os.DevNull)
+ os.Stdout = null
+ }
// Currently it is only possible to restore a container with the same runtime
// as used for checkpointing. It should be possible to make crun and runc
@@ -343,6 +347,7 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) {
lFlags.StringVar(&opts.Identity, identityFlagName, ident, "path to SSH identity file, (CONTAINER_SSHKEY)")
_ = cmd.RegisterFlagCompletionFunc(identityFlagName, completion.AutocompleteDefault)
+ lFlags.BoolVar(&opts.NoOut, "noout", false, "do not output to stdout")
lFlags.BoolVarP(&opts.Remote, "remote", "r", registry.IsRemote(), "Access remote Podman service")
pFlags := cmd.PersistentFlags()
if registry.IsRemote() {