mirror of
https://github.com/containers/podman.git
synced 2025-10-14 01:35:29 +08:00
spf13/pflag: replace deprecated ParseErrorsWhitelist
Use ParseErrorsAllowlist instead, should still work the exact same. Signed-off-by: Paul Holzinger <pholzing@redhat.com>
This commit is contained in:
@ -254,7 +254,7 @@ func composeMain(cmd *cobra.Command, args []string) error {
|
||||
// after `podman compose [ARGS]` are passed to the compose provider.
|
||||
// For now, we only look for the --help flag.
|
||||
fs := pflag.NewFlagSet("args", pflag.ContinueOnError)
|
||||
fs.ParseErrorsWhitelist.UnknownFlags = true
|
||||
fs.ParseErrorsAllowlist.UnknownFlags = true
|
||||
fs.SetInterspersed(false)
|
||||
fs.BoolP("help", "h", false, "")
|
||||
if err := fs.Parse(args); err != nil {
|
||||
|
@ -70,7 +70,7 @@ func containersConfModules() ([]string, error) {
|
||||
|
||||
var modules []string
|
||||
fs := pflag.NewFlagSet("module", pflag.ContinueOnError)
|
||||
fs.ParseErrorsWhitelist.UnknownFlags = true
|
||||
fs.ParseErrorsAllowlist.UnknownFlags = true
|
||||
fs.Usage = func() {}
|
||||
fs.SetInterspersed(false)
|
||||
fs.StringArrayVar(&modules, "module", nil, "")
|
||||
|
@ -36,7 +36,7 @@ func IsRemote() bool {
|
||||
remote = true
|
||||
}
|
||||
fs := pflag.NewFlagSet("remote", pflag.ContinueOnError)
|
||||
fs.ParseErrorsWhitelist.UnknownFlags = true
|
||||
fs.ParseErrorsAllowlist.UnknownFlags = true
|
||||
fs.Usage = func() {}
|
||||
fs.SetInterspersed(false)
|
||||
fs.BoolVarP(&remoteFromCLI.Value, "remote", "r", remote, "")
|
||||
|
@ -358,7 +358,7 @@ func executeContainerTemplate(info *containerInfo, options entities.GenerateSyst
|
||||
remainingCmd := info.CreateCommand[index:]
|
||||
// Presence check for certain flags/options.
|
||||
fs := pflag.NewFlagSet("args", pflag.ContinueOnError)
|
||||
fs.ParseErrorsWhitelist.UnknownFlags = true
|
||||
fs.ParseErrorsAllowlist.UnknownFlags = true
|
||||
fs.Usage = func() {}
|
||||
fs.SetInterspersed(false)
|
||||
fs.BoolP("detach", "d", false, "")
|
||||
|
@ -339,7 +339,7 @@ func executePodTemplate(info *podInfo, options entities.GenerateSystemdOptions)
|
||||
|
||||
// Presence check for certain flags/options.
|
||||
fs := pflag.NewFlagSet("args", pflag.ContinueOnError)
|
||||
fs.ParseErrorsWhitelist.UnknownFlags = true
|
||||
fs.ParseErrorsAllowlist.UnknownFlags = true
|
||||
fs.Usage = func() {}
|
||||
fs.SetInterspersed(false)
|
||||
fs.String("name", "", "")
|
||||
|
Reference in New Issue
Block a user