-
-let build_dev args =
- if List.length args <> 1 then !usage ();
- let name = (List.hd args) in
- let dev = dev_of_name name in
- match MK.build_development dev with
- | true -> exit 0
- | false -> exit 1
-;;
-
-let target args =
- if List.length args < 1 then !usage ();
- let dev = dev_for_dir (Unix.getcwd ()) in
- List.iter
- (fun t ->
- ignore(MK.build_development ~target:t dev))
- args
-;;
-
-let params = [
- "-init", init_dev, init_dev_doc;
- "-clean", clean_dev, clean_dev_doc;
- "-list", list_dev, list_dev_doc;
- "-destroy", destroy_dev, destroy_dev_doc;
- "-build", build_dev, build_dev_doc;
- "-h", (fun _ -> !usage()), "print this help screen";
- "-help", (fun _ -> !usage()), "print this help screen";
-]
-;;
-
-usage := fun () ->
- let p = prerr_endline in
- p "\nusage:";
- p "\tmatitamake(.opt) [command [options]]\n";
- p "\tmatitamake(.opt) [target]\n";
- p "commands:";
- List.iter (fun (n,_,d) -> p (Printf.sprintf " %-10s%s" n d)) params;
- p "\nIf target is omitted a 'all' will be used as the default.";
- p "With -build you can build a development wherever it is.";
- p "If you specify a target it implicitly refers to the development that";
- p "holds the current working directory (if any).\n";
- exit 1
-;;
-
-let parse args =
- match args with
- | [] -> target ["all"]
- | s::tl ->
- try
- let _,f,_ = List.find (fun (n,_,_) -> n = s) params in
- f tl
- with Not_found -> if s.[0] = '-' then !usage () else target args
-
-let _ =
+ in
+ let build_dev args =
+ if List.length args <> 1 then !usage ();
+ let name = (List.hd args) in
+ let dev = dev_of_name name in
+ match MK.build_development dev with
+ | true -> exit 0
+ | false -> exit 1
+ in
+ let nodb_doc = "
+\tParameters:
+\tDescription: avoid using external database connection."
+ in
+ let nodb _ = Helm_registry.set_bool "db.nodb" true in
+ let target args =
+ if List.length args < 1 then !usage ();
+ let dev = dev_for_dir (Unix.getcwd ()) in
+ List.iter
+ (fun t ->
+ ignore(MK.build_development ~target:t dev))
+ args
+ in
+ let params = [
+ "-init", init_dev, init_dev_doc;
+ "-clean", clean_dev, clean_dev_doc;
+ "-list", list_dev, list_dev_doc;
+ "-destroy", destroy_dev, destroy_dev_doc;
+ "-build", build_dev, build_dev_doc;
+ "-nodb", nodb, nodb_doc;
+ "-h", (fun _ -> !usage()), "print this help screen";
+ "-help", (fun _ -> !usage()), "print this help screen";
+ ]
+ in
+ usage := (fun () ->
+ let p = prerr_endline in
+ p "\nusage:";
+ p "\tmatitamake(.opt) [command [options]]\n";
+ p "\tmatitamake(.opt) [target]\n";
+ p "commands:";
+ List.iter (fun (n,_,d) -> p (Printf.sprintf " %-10s%s" n d)) params;
+ p "\nIf target is omitted a 'all' will be used as the default.";
+ p "With -build you can build a development wherever it is.";
+ p "If you specify a target it implicitly refers to the development that";
+ p "holds the current working directory (if any).\n";
+ exit 1);
+ let rec parse args =
+ match args with
+ | [] -> target ["all"]
+ | s::tl ->
+ try
+ let _,f,_ = List.find (fun (n,_,_) -> n = s) params in
+ f tl;
+ parse tl
+ with Not_found -> if s.[0] = '-' then !usage () else target args
+ in