Skip to content

Commit 29ebdf4

Browse files
committed
feature(4890): added fatal log in case there is an error while marking force flag as hidden
1 parent e3e0165 commit 29ebdf4

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/pkg/agent/cmd/upgrade.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ package cmd
77
import (
88
"context"
99
"fmt"
10+
"log"
1011
"os"
1112
"strings"
1213

@@ -57,7 +58,10 @@ func newUpgradeCommandWithArgs(_ []string, streams *cli.IOStreams) *cobra.Comman
5758
cmd.Flags().String(flagPGPBytesURI, "", "Path to a web location containing PGP to use for package verification")
5859
cmd.Flags().String(flagPGPBytesPath, "", "Path to a file containing PGP to use for package verification")
5960
cmd.Flags().BoolP(flagForce, "f", false, "Advanced option to force an upgrade on a fleet managed agent")
60-
cmd.Flags().MarkHidden(flagForce)
61+
err := cmd.Flags().MarkHidden(flagForce)
62+
if err != nil {
63+
log.Fatal(err)
64+
}
6165

6266
return cmd
6367
}

0 commit comments

Comments
 (0)