diff options
author | openshift-ci[bot] <75433959+openshift-ci[bot]@users.noreply.github.com> | 2022-07-18 17:12:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-18 17:12:30 +0000 |
commit | d890c4d98edcd2ed6f5f26bb19ed2282cea1cb46 (patch) | |
tree | 006f1ef9d3a9aa1f45d8b9eeff10346b839ff6a1 /cmd | |
parent | 5201ea8e4176dfc6cfd2816e5cf1c3fa0adf9587 (diff) | |
parent | 18c0c19aa91a0cb0c493c415d5b2b4c3627ad5e9 (diff) | |
download | podman-d890c4d98edcd2ed6f5f26bb19ed2282cea1cb46.tar.gz podman-d890c4d98edcd2ed6f5f26bb19ed2282cea1cb46.tar.bz2 podman-d890c4d98edcd2ed6f5f26bb19ed2282cea1cb46.zip |
Merge pull request #14947 from rhatdan/root
Add --host and -H as equivalent options to --url
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/registry/remote.go | 10 | ||||
-rw-r--r-- | cmd/podman/root.go | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/cmd/podman/registry/remote.go b/cmd/podman/registry/remote.go index 181ef6b4a..afe32e0b9 100644 --- a/cmd/podman/registry/remote.go +++ b/cmd/podman/registry/remote.go @@ -31,11 +31,11 @@ func IsRemote() bool { fs.SetInterspersed(false) fs.BoolVarP(&remoteFromCLI.Value, "remote", "r", remote, "") connectionFlagName := "connection" - ignoredConnection := "" - fs.StringVarP(&ignoredConnection, connectionFlagName, "c", "", "") + fs.StringP(connectionFlagName, "c", "", "") + hostFlagName := "host" + fs.StringP(hostFlagName, "H", "", "") urlFlagName := "url" - ignoredURL := "" - fs.StringVar(&ignoredURL, urlFlagName, "", "") + fs.String(urlFlagName, "", "") // The shell completion logic will call a command called "__complete" or "__completeNoDesc" // This command will always be the second argument @@ -46,7 +46,7 @@ func IsRemote() bool { } _ = fs.Parse(os.Args[start:]) // --connection or --url implies --remote - remoteFromCLI.Value = remoteFromCLI.Value || fs.Changed(connectionFlagName) || fs.Changed(urlFlagName) + remoteFromCLI.Value = remoteFromCLI.Value || fs.Changed(connectionFlagName) || fs.Changed(urlFlagName) || fs.Changed(hostFlagName) }) return podmanOptions.EngineMode == entities.TunnelMode || remoteFromCLI.Value } diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 0520a0784..48f8470be 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -345,6 +345,8 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { urlFlagName := "url" lFlags.StringVar(&opts.URI, urlFlagName, uri, "URL to access Podman service (CONTAINER_HOST)") _ = cmd.RegisterFlagCompletionFunc(urlFlagName, completion.AutocompleteDefault) + lFlags.StringVarP(&opts.URI, "host", "H", uri, "Used for Docker compatibility") + _ = lFlags.MarkHidden("host") // Context option added just for compatibility with DockerCLI. lFlags.String("context", "default", "Name of the context to use to connect to the daemon (This flag is a NOOP and provided solely for scripting compatibility.)") |