From 6e352ae930e4789a4da6d3d3beb1e827d7c2a63f Mon Sep 17 00:00:00 2001 From: Rudi Grinberg Date: Wed, 11 Jul 2018 12:42:37 +0200 Subject: [PATCH] Move custom args to Arg submodule Signed-off-by: Rudi Grinberg --- bin/main.ml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/bin/main.ml b/bin/main.ml index 31052d306c77..051b7cedd799 100644 --- a/bin/main.ml +++ b/bin/main.ml @@ -185,13 +185,17 @@ let find_root () = in (dir, to_cwd) -let package_name = - Arg.conv ((fun p -> Ok (Package.Name.of_string p)), Package.Name.pp) +module Arg = struct + include Arg -let path_arg = - Arg.conv ((fun p -> Ok (Path.of_filename_relative_to_initial_cwd p)) - , Path.pp - ) + let package_name = + Arg.conv ((fun p -> Ok (Package.Name.of_string p)), Package.Name.pp) + + let path = + Arg.conv ((fun p -> Ok (Path.of_filename_relative_to_initial_cwd p)) + , Path.pp + ) +end let common_footer = `Blocks @@ -436,7 +440,7 @@ let common = in let workspace_file = Arg.(value - & opt (some path_arg) None + & opt (some path) None & info ["workspace"] ~docs ~docv:"FILE" ~doc:"Use this specific workspace file instead of looking it up.") in @@ -473,7 +477,7 @@ let common = let config_file = let config_file = Arg.(value - & opt (some path_arg) None + & opt (some path) None & info ["config-file"] ~docs ~docv:"FILE" ~doc:"Load this configuration file instead of the default one.") in