diff options
Diffstat (limited to 'cmd/podman')
-rw-r--r-- | cmd/podman/common/completion.go | 4 | ||||
-rw-r--r-- | cmd/podman/containers/port.go | 2 | ||||
-rw-r--r-- | cmd/podman/containers/rename.go | 7 |
3 files changed, 6 insertions, 7 deletions
diff --git a/cmd/podman/common/completion.go b/cmd/podman/common/completion.go index d01842998..c9a3c5e94 100644 --- a/cmd/podman/common/completion.go +++ b/cmd/podman/common/completion.go @@ -517,8 +517,8 @@ func AutocompleteRunlabelCommand(cmd *cobra.Command, args []string, toComplete s return nil, cobra.ShellCompDirectiveDefault } -// AutocompletePortCommand - Autocomplete podman port command args. -func AutocompletePortCommand(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { +// AutocompleteContainerOneArg - Autocomplete containers as fist arg. +func AutocompleteContainerOneArg(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { if !validCurrentCmdLine(cmd, args, toComplete) { return nil, cobra.ShellCompDirectiveNoFileComp } diff --git a/cmd/podman/containers/port.go b/cmd/podman/containers/port.go index d59161149..4d3a5310d 100644 --- a/cmd/podman/containers/port.go +++ b/cmd/podman/containers/port.go @@ -26,7 +26,7 @@ var ( Args: func(cmd *cobra.Command, args []string) error { return validate.CheckAllLatestAndCIDFile(cmd, args, true, false) }, - ValidArgsFunction: common.AutocompletePortCommand, + ValidArgsFunction: common.AutocompleteContainerOneArg, Example: `podman port --all podman port ctrID 80/tcp podman port --latest 80`, diff --git a/cmd/podman/containers/rename.go b/cmd/podman/containers/rename.go index 9c94e6272..78bd3db83 100644 --- a/cmd/podman/containers/rename.go +++ b/cmd/podman/containers/rename.go @@ -16,7 +16,7 @@ var ( Long: renameDescription, RunE: rename, Args: cobra.ExactArgs(2), - ValidArgsFunction: common.AutocompletePortCommand, + ValidArgsFunction: common.AutocompleteContainerOneArg, Example: "podman rename containerA newName", } @@ -32,14 +32,13 @@ var ( ) func init() { - // TODO: Once bindings are done, add this to TunnelMode registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: renameCommand, }) registry.Commands = append(registry.Commands, registry.CliCommand{ - Mode: []entities.EngineMode{entities.ABIMode}, + Mode: []entities.EngineMode{entities.ABIMode, entities.TunnelMode}, Command: containerRenameCommand, Parent: containerCmd, }) |