Parcourir la source

Merge from a local clone into dev

Leo il y a 9 ans
Parent
commit
e722764d3b
6 fichiers modifiés avec 24 ajouts et 25 suppressions
  1. 1 3
      _oasis
  2. 9 5
      fix-indent.ml
  3. 1 1
      opam
  4. 5 13
      setup.ml
  5. 2 1
      src/command_def.ml
  6. 6 2
      src/file_com.ml

+ 1 - 3
_oasis

@@ -34,13 +34,11 @@ Executable oclaunch
 Executable "run_test"
   Path: src
   MainIs: test/test.ml
-  Build$: flag(tests)
   CompiledObject: best
   Install: false
   BuildDepends: alcotest, oUnit, core, textutils, atdgen, threads, re2
 
-Test "tests"
-  Run$: flag(tests)
+Test tests
   Command: $run_test -q
   WorkingDirectory: src/test
 

+ 9 - 5
fix-indent.ml

@@ -36,8 +36,11 @@
 (******************************************************************************)
 
 open Core.Std;;
-(* TODO:
- * - Tidy exit codes *)
+
+(* Exit codes *)
+let exit_ok () = exit 0;;
+let exit_arg_lack () = exit 1;;
+let exit_ocp_indent_error () = exit 2;;
 
 let ignored =
   (* File (space separated) to be ignored, regexp passed to tree command *)
@@ -74,7 +77,8 @@ let ocp_indent file =
   |> Sys.command
   |> function
   | 0 -> printf "File: '%s' ok\n" file
-  | error -> printf "Error with file: '%s'; code: %i\n%!" file error; exit 3
+  | error -> printf "Error with file: '%s'; code: %i\n%!" file error;
+      exit_ocp_indent_error ()
 ;;
 
 let () =
@@ -82,9 +86,9 @@ let () =
     [| _; path |] ->
     list_mlfiles path |> List.iter ~f:ocp_indent;
     printf "Done\n%!";
-    exit 0
+    exit_ok ()
   | _ -> printf "Usage: %s [directory containing file to indent]\n"
            Sys.executable_name;
-    exit 1
+    exit_arg_lack ()
 ;;
 

+ 1 - 1
opam

@@ -17,7 +17,7 @@ remove: ["ocamlfind" "remove" "ocl"]
 depends: [
   "atdgen"
   "base-threads"
-  "core"
+  "core" {>= "112.35.00"}
   "textutils"
   "re2"
   "ocamlfind" {build}

+ 5 - 13
setup.ml

@@ -1,7 +1,7 @@
 (* setup.ml generated for the first time by OASIS v0.4.5 *)
 
 (* OASIS_START *)
-(* DO NOT EDIT (digest: 29148222c3727c6a2e17ba86cbb4f853) *)
+(* DO NOT EDIT (digest: 70330b54881acd2561c71818e36b1198) *)
 (*
    Regenerated by OASIS v0.4.5
    Visit http://oasis.forge.ocamlcore.org for more information and
@@ -6951,11 +6951,7 @@ let setup_t =
                      cs_plugin_data = []
                   },
                    {
-                      bs_build =
-                        [
-                           (OASISExpr.EBool true, false);
-                           (OASISExpr.EFlag "tests", true)
-                        ];
+                      bs_build = [(OASISExpr.EBool true, true)];
                       bs_install = [(OASISExpr.EBool true, false)];
                       bs_path = "src";
                       bs_compiled_object = Best;
@@ -7000,11 +6996,7 @@ let setup_t =
                       test_run =
                         [
                            (OASISExpr.ENot (OASISExpr.EFlag "tests"), false);
-                           (OASISExpr.EFlag "tests", false);
-                           (OASISExpr.EAnd
-                              (OASISExpr.EFlag "tests",
-                                OASISExpr.EFlag "tests"),
-                             true)
+                           (OASISExpr.EFlag "tests", true)
                         ];
                       test_tools =
                         [ExternalTool "ocamlbuild"; ExternalTool "camlp4o"]
@@ -7021,7 +7013,7 @@ let setup_t =
        };
      oasis_fn = Some "_oasis";
      oasis_version = "0.4.5";
-     oasis_digest = Some "\029\r\237\218zXPf\207\238d\143\005\003\189s";
+     oasis_digest = Some "\138\184\215\201c-\148D\234\195o\127\134\128#1";
      oasis_exec = None;
      oasis_setup_args = [];
      setup_update = false
@@ -7029,6 +7021,6 @@ let setup_t =
 
 let setup () = BaseSetup.setup setup_t;;
 
-# 7033 "setup.ml"
+# 7025 "setup.ml"
 (* OASIS_STOP *)
 let () = setup ();;

+ 2 - 1
src/command_def.ml

@@ -234,7 +234,8 @@ let licence =
            ~doc:" Display the header associated to the licence"
     )
     (fun _ header () ->
-       let cecill = not(header) in (* When cecill is false, it displays the header *)
+       (* When cecill is false, it displays the header *)
+       let cecill = not(header) in
        Licencing.print ~cecill
     )
 ;;

+ 6 - 2
src/file_com.ml

@@ -61,8 +61,12 @@ let rc_template () =
  * exist *)
 let create_rc_file ~name =
   (* Notify that we initialise config file *)
-  sprintf "Initializing empty configuration file in %s\n" name |> Messages.warning;
-  Messages.tips "Feedback is welcomed at leowzukw@vmail.me\n";
+  sprintf "Initializing empty configuration file in %s." name |> Messages.warning;
+  (* Final \n to display newline before showing the licence. *)
+  Messages.tips "Feedback is welcome at feedback@oclaunch.eu.org.\n\
+  To get remind for new stable versions, subscribe to our low-traffic (up to 6 \
+  mail per year) mailing list: announce@oclaunch.eu.org.\n\
+  See you soon!\n";
 
   (* Display licence information *)
   Licencing.print ~cecill:false;