Skip to content

Commit

Permalink
add SilenceUsage and fix usage for flag
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsgstrabo committed Apr 12, 2024
1 parent 85cd52d commit 96baf2c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cmd/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ var loginCmd = &cobra.Command{
Short: "Login to Radix",
Long: `Login to Radix.`,
RunE: func(cmd *cobra.Command, args []string) error {
cmd.SilenceUsage = true

useDeviceCode, _ := cmd.Flags().GetBool(flagnames.UseDeviceCode)
err := client.LoginCommand(cmd, useDeviceCode)
if err != nil {
Expand All @@ -38,6 +40,6 @@ var loginCmd = &cobra.Command{

func init() {
rootCmd.AddCommand(loginCmd)
loginCmd.Flags().Bool(flagnames.UseDeviceCode, false, "Name of the application")
loginCmd.Flags().Bool(flagnames.UseDeviceCode, false, "Use CLI's old authentication flow based on device code")
setVerbosePersistentFlag(loginCmd)
}

0 comments on commit 96baf2c

Please sign in to comment.