Parcourir la source

Clean-up licensing code (language question)

 + Shift answer to lowercase to test less cases. Would be more flexible
 to the user.
 + Analog to commit cdc51c550a6d38a82f364f1537f7c01cb0651e1b.
Leo il y a 9 ans
Parent
commit
ffe930c4bf
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      src/licencing.ml

+ 3 - 2
src/licencing.ml

@@ -1211,9 +1211,10 @@ let print ~cecill =
            Option.value ~default:"" str |> Messages.debug;
            Option.value ~default:"" str |> Messages.debug;
            str)
            str)
 
 
+      |> Option.map ~f:String.lowercase
       |> (function
       |> (function
-           | Some "en" | Some "En" | Some "EN" -> `En
-           | Some "fr" | Some "Fr" | Some "FR"-> `Fr
+           | Some "en" -> `En
+           | Some "fr" -> `Fr
            | None | Some _ -> Messages.warning "Please enter 'Fr' or 'En'"; def_lang ()
            | None | Some _ -> Messages.warning "Please enter 'Fr' or 'En'"; def_lang ()
          ))
          ))
   in
   in