@@ -611,17 +611,20 @@ var logoutCmd = &cobra.Command{
611
611
},
612
612
}
613
613
614
- var eulaCmd = & cobra.Command {
615
- Use : "eula" ,
614
+ var tosCmd = & cobra.Command {
615
+ Use : "terms" ,
616
+ Aliases : []string {"tos" , "eula" },
616
617
Annotations : authNeededAnnotation ,
617
618
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 " ,
619
620
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" )
622
623
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" )
625
628
}
626
629
return nil
627
630
},
@@ -639,8 +642,8 @@ func main() {
639
642
//rootCmd.PersistentFlags().StringVarP(&userLicense, "license", "l", "", "name of license for the project")
640
643
641
644
// 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 )
644
647
645
648
// Token command
646
649
tokenCmd .Flags ().Duration ("expires" , 24 * time .Hour , "Validity duration of the token" )
@@ -767,8 +770,8 @@ func main() {
767
770
if code == connect .CodeUnauthenticated {
768
771
printDefangHint ("Please use the following command to log in:" , "login" )
769
772
}
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" )
772
775
}
773
776
774
777
os .Exit (int (code ))
0 commit comments