mirror of
https://github.com/containers/podman.git
synced 2025-06-26 04:46:57 +08:00
Merge pull request #8988 from Luap99/rename-port-completion-func
[CI:DOCS] Rename AutocompletePortCommand func
This commit is contained in:
@ -517,8 +517,8 @@ func AutocompleteRunlabelCommand(cmd *cobra.Command, args []string, toComplete s
|
|||||||
return nil, cobra.ShellCompDirectiveDefault
|
return nil, cobra.ShellCompDirectiveDefault
|
||||||
}
|
}
|
||||||
|
|
||||||
// AutocompletePortCommand - Autocomplete podman port command args.
|
// AutocompleteContainerOneArg - Autocomplete containers as fist arg.
|
||||||
func AutocompletePortCommand(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
func AutocompleteContainerOneArg(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||||
if !validCurrentCmdLine(cmd, args, toComplete) {
|
if !validCurrentCmdLine(cmd, args, toComplete) {
|
||||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ var (
|
|||||||
Args: func(cmd *cobra.Command, args []string) error {
|
Args: func(cmd *cobra.Command, args []string) error {
|
||||||
return validate.CheckAllLatestAndCIDFile(cmd, args, true, false)
|
return validate.CheckAllLatestAndCIDFile(cmd, args, true, false)
|
||||||
},
|
},
|
||||||
ValidArgsFunction: common.AutocompletePortCommand,
|
ValidArgsFunction: common.AutocompleteContainerOneArg,
|
||||||
Example: `podman port --all
|
Example: `podman port --all
|
||||||
podman port ctrID 80/tcp
|
podman port ctrID 80/tcp
|
||||||
podman port --latest 80`,
|
podman port --latest 80`,
|
||||||
|
@ -16,7 +16,7 @@ var (
|
|||||||
Long: renameDescription,
|
Long: renameDescription,
|
||||||
RunE: rename,
|
RunE: rename,
|
||||||
Args: cobra.ExactArgs(2),
|
Args: cobra.ExactArgs(2),
|
||||||
ValidArgsFunction: common.AutocompletePortCommand,
|
ValidArgsFunction: common.AutocompleteContainerOneArg,
|
||||||
Example: "podman rename containerA newName",
|
Example: "podman rename containerA newName",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user