From c0e07234631cfcea1d6724c05606964a4d833f39 Mon Sep 17 00:00:00 2001 From: Paul Holzinger Date: Tue, 18 Jan 2022 16:17:53 +0100 Subject: rename --cni-config-dir to --network-config-dir Since this option will also be used for netavark we should rename it to something more generic. It is important that --cni-config-dir still works otherwise we could break existing container cleanup commands. Signed-off-by: Paul Holzinger --- cmd/podman/root.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'cmd') diff --git a/cmd/podman/root.go b/cmd/podman/root.go index 7989f9cd5..be6eacfc2 100644 --- a/cmd/podman/root.go +++ b/cmd/podman/root.go @@ -85,6 +85,14 @@ func init() { ) rootFlags(rootCmd, registry.PodmanConfig()) + + // backwards compat still allow --cni-config-dir + rootCmd.Flags().SetNormalizeFunc(func(f *pflag.FlagSet, name string) pflag.NormalizedName { + if name == "cni-config-dir" { + name = "network-config-dir" + } + return pflag.NormalizedName(name) + }) rootCmd.SetUsageTemplate(usageTemplate) } @@ -371,9 +379,9 @@ func rootFlags(cmd *cobra.Command, opts *entities.PodmanConfig) { pFlags.StringVar(&cfg.Engine.NetworkCmdPath, networkCmdPathFlagName, cfg.Engine.NetworkCmdPath, "Path to the command for configuring the network") _ = cmd.RegisterFlagCompletionFunc(networkCmdPathFlagName, completion.AutocompleteDefault) - cniConfigDirFlagName := "cni-config-dir" - pFlags.StringVar(&cfg.Network.NetworkConfigDir, cniConfigDirFlagName, cfg.Network.NetworkConfigDir, "Path of the configuration directory for CNI networks") - _ = cmd.RegisterFlagCompletionFunc(cniConfigDirFlagName, completion.AutocompleteDefault) + networkConfigDirFlagName := "network-config-dir" + pFlags.StringVar(&cfg.Network.NetworkConfigDir, networkConfigDirFlagName, cfg.Network.NetworkConfigDir, "Path of the configuration directory for networks") + _ = cmd.RegisterFlagCompletionFunc(networkConfigDirFlagName, completion.AutocompleteDefault) pFlags.StringVar(&cfg.Containers.DefaultMountsFile, "default-mounts-file", cfg.Containers.DefaultMountsFile, "Path to default mounts file") -- cgit v1.2.3-54-g00ecf