Move custom args to Arg submodule
Signed-off-by: Rudi Grinberg <rudi.grinberg@gmail.com>
This commit is contained in:
parent
02beadb856
commit
ab85720a06
20
bin/main.ml
20
bin/main.ml
|
@ -185,13 +185,17 @@ let find_root () =
|
||||||
in
|
in
|
||||||
(dir, to_cwd)
|
(dir, to_cwd)
|
||||||
|
|
||||||
let package_name =
|
module Arg = struct
|
||||||
Arg.conv ((fun p -> Ok (Package.Name.of_string p)), Package.Name.pp)
|
include Arg
|
||||||
|
|
||||||
let path_arg =
|
let package_name =
|
||||||
Arg.conv ((fun p -> Ok (Path.of_filename_relative_to_initial_cwd p))
|
Arg.conv ((fun p -> Ok (Package.Name.of_string p)), Package.Name.pp)
|
||||||
, Path.pp
|
|
||||||
)
|
let path =
|
||||||
|
Arg.conv ((fun p -> Ok (Path.of_filename_relative_to_initial_cwd p))
|
||||||
|
, Path.pp
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
let common_footer =
|
let common_footer =
|
||||||
`Blocks
|
`Blocks
|
||||||
|
@ -436,7 +440,7 @@ let common =
|
||||||
in
|
in
|
||||||
let workspace_file =
|
let workspace_file =
|
||||||
Arg.(value
|
Arg.(value
|
||||||
& opt (some path_arg) None
|
& opt (some path) None
|
||||||
& info ["workspace"] ~docs ~docv:"FILE"
|
& info ["workspace"] ~docs ~docv:"FILE"
|
||||||
~doc:"Use this specific workspace file instead of looking it up.")
|
~doc:"Use this specific workspace file instead of looking it up.")
|
||||||
in
|
in
|
||||||
|
@ -473,7 +477,7 @@ let common =
|
||||||
let config_file =
|
let config_file =
|
||||||
let config_file =
|
let config_file =
|
||||||
Arg.(value
|
Arg.(value
|
||||||
& opt (some path_arg) None
|
& opt (some path) None
|
||||||
& info ["config-file"] ~docs ~docv:"FILE"
|
& info ["config-file"] ~docs ~docv:"FILE"
|
||||||
~doc:"Load this configuration file instead of the default one.")
|
~doc:"Load this configuration file instead of the default one.")
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in New Issue