diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-05-22 16:27:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-22 16:27:30 +0200 |
commit | e0376b9c3f9af07d9e58a04a7cd58a7c065305e3 (patch) | |
tree | 79827018a55478e0688033ee8130d81919be36c8 /cmd/podman/logout.go | |
parent | 9db66b2fe346101b05e45f33ef38ed09e163f718 (diff) | |
parent | baed81029b74c8d801ea9d5cf67a78005472e6ed (diff) | |
download | podman-e0376b9c3f9af07d9e58a04a7cd58a7c065305e3.tar.gz podman-e0376b9c3f9af07d9e58a04a7cd58a7c065305e3.tar.bz2 podman-e0376b9c3f9af07d9e58a04a7cd58a7c065305e3.zip |
Merge pull request #3108 from rhatdan/flags
Fixup Flags
Diffstat (limited to 'cmd/podman/logout.go')
-rw-r--r-- | cmd/podman/logout.go | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cmd/podman/logout.go b/cmd/podman/logout.go index ec581a098..5df838bba 100644 --- a/cmd/podman/logout.go +++ b/cmd/podman/logout.go @@ -24,20 +24,23 @@ var ( logoutCommand.Remote = remoteclient return logoutCmd(&logoutCommand) }, - Example: `podman logout docker.io - podman logout --authfile authdir/myauths.json docker.io + Example: `podman logout quay.io podman logout --all`, } ) func init() { + if !remote { + _logoutCommand.Example = fmt.Sprintf("%s\n podman logout --authfile authdir/myauths.json quay.io", _logoutCommand.Example) + + } logoutCommand.Command = _logoutCommand logoutCommand.SetHelpTemplate(HelpTemplate()) logoutCommand.SetUsageTemplate(UsageTemplate()) flags := logoutCommand.Flags() flags.BoolVarP(&logoutCommand.All, "all", "a", false, "Remove the cached credentials for all registries in the auth file") - flags.StringVar(&logoutCommand.Authfile, "authfile", "", "Path of the authentication file. Default is ${XDG_RUNTIME_DIR}/containers/auth.json. Use REGISTRY_AUTH_FILE environment variable to override") - + flags.StringVar(&logoutCommand.Authfile, "authfile", getAuthFile(""), "Path of the authentication file. Use REGISTRY_AUTH_FILE environment variable to override") + markFlagHiddenForRemoteClient("authfile", flags) } // logoutCmd uses the authentication package to remove the authenticated of a registry @@ -54,9 +57,8 @@ func logoutCmd(c *cliconfig.LogoutValues) error { if len(args) == 1 { server = scrubServer(args[0]) } - authfile := getAuthFile(c.Authfile) - sc := image.GetSystemContext("", authfile, false) + sc := image.GetSystemContext("", c.Authfile, false) if c.All { if err := config.RemoveAllAuthentication(sc); err != nil { |