podmanV2: fix nil deref

Fix a typo when looking up a flag causing a nil deref and all commands
to fail.

Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
This commit is contained in:
Valentin Rothberg
2020-04-15 11:57:35 +02:00
parent f0b6cdede5
commit 123158e83b

View File

@@ -71,7 +71,7 @@ func preRunE(cmd *cobra.Command, _ []string) error {
cmd.SetHelpTemplate(registry.HelpTemplate())
cmd.SetUsageTemplate(registry.UsageTemplate())
if cmd.Flag("cpu_profile").Changed {
if cmd.Flag("cpu-profile").Changed {
f, err := os.Create(registry.PodmanOptions.CpuProfile)
if err != nil {
return errors.Wrapf(err, "unable to create cpu profiling file %s",