Skip to content

Commit b27399b

Browse files
committed
rename eula to terms
1 parent 28d2517 commit b27399b

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

src/cmd/cli/main.go

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -611,17 +611,20 @@ var logoutCmd = &cobra.Command{
611611
},
612612
}
613613

614-
var eulaCmd = &cobra.Command{
615-
Use: "eula",
614+
var tosCmd = &cobra.Command{
615+
Use: "terms",
616+
Aliases: []string{"tos", "eula"},
616617
Annotations: authNeededAnnotation,
617618
Args: cobra.NoArgs,
618-
Short: "Read and/or agree the Defang terms of service",
619+
Short: "Read and/or agree the Defang terms and conditions",
619620
RunE: func(cmd *cobra.Command, args []string) error {
620-
agreeToS, _ := cmd.Flags().GetBool("agree-tos")
621-
cli.Println("Read our latest terms of service at https://defang.io/terms-conditions.html")
621+
agreeToS, _ := cmd.Flags().GetBool("agree")
622+
cli.Println("Read our latest terms and conditions at https://defang.io/terms-conditions.html")
622623
if agreeToS {
623-
_, err := client.SignEULA(cmd.Context(), &connect.Request[emptypb.Empty]{})
624-
return err
624+
if _, err := client.SignEULA(cmd.Context(), &connect.Request[emptypb.Empty]{}); err != nil {
625+
return err
626+
}
627+
cli.Info(" * You have agreed to the Defang terms and conditions")
625628
}
626629
return nil
627630
},
@@ -639,8 +642,8 @@ func main() {
639642
//rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project")
640643

641644
// Eula command
642-
eulaCmd.Flags().Bool("agree-tos", false, "Agree to the Defang terms of service")
643-
rootCmd.AddCommand(eulaCmd)
645+
tosCmd.Flags().Bool("agree", false, "Agree to the Defang terms of service")
646+
rootCmd.AddCommand(tosCmd)
644647

645648
// Token command
646649
tokenCmd.Flags().Duration("expires", 24*time.Hour, "Validity duration of the token")
@@ -767,8 +770,8 @@ func main() {
767770
if code == connect.CodeUnauthenticated {
768771
printDefangHint("Please use the following command to log in:", "login")
769772
}
770-
if code == connect.CodeFailedPrecondition && strings.Contains(err.Error(), "EULA") {
771-
printDefangHint("Please use the following command to agree to the terms of service:", "eula --agree-tos")
773+
if code == connect.CodeFailedPrecondition && (strings.Contains(err.Error(), "EULA") || strings.Contains(err.Error(), "terms")) {
774+
printDefangHint("Please use the following command to agree to the Defang terms and conditions:", "terms --agree")
772775
}
773776

774777
os.Exit(int(code))

0 commit comments

Comments
 (0)