ADD Specify package name
1 files changed, 8 insertions(+), 1 deletions(-)

M src/hll/hll.ml
M src/hll/hll.ml +8 -1
@@ 9,6 9,10 @@ module Cmdline = struct
   module C = Cmdliner
 
   let generate_cmd generate_pkg =
+    let pkg_name =
+      let doc = "Name of the package, defaults to current dir name" in
+      C.Arg.(value & opt (some string) None & info ["n"; "name"] ~docv:"NAME" ~doc)
+    in
     let opam_dir =
       let doc = "Path to the output opam repo directory" in
       C.Arg.(required & opt (some dir) None & info ["opam-dir"] ~docv:"DIR" ~doc)

          
@@ 35,6 39,7 @@ module Cmdline = struct
     in
     let doc = "generate an opam package from a pds and an hll config" in
     C.Term.(const generate_pkg $
+            pkg_name $
             opam_dir $
             tag $
             pins_file $

          
@@ 688,6 693,7 @@ let merge_pins_with_selector_deps pins p
     pins
 
 let generate_pkg
+    name_opt
     opam_dir
     (tag_opt : string option)
     pins_file_opt

          
@@ 721,10 727,11 @@ let generate_pkg
               ; pds_version = hll_conf.Generate_io.Hll_conf.pds_version
               })
   in
+  let name = CCOpt.get_or ~default:(Filename.basename (Sys.getcwd ())) name_opt in
   let contents = Generate.generate_pkg_content gen_t in
   Generate_io.output_pkg
     ~opam_dir
-    ~name:(Filename.basename (Sys.getcwd ()))
+    ~name
     ~tag
     ~contents