From 826c4eac7bac2175d6d30532f3f04176f9ad145b Mon Sep 17 00:00:00 2001 From: Mathieu Barbin Date: Sat, 12 Oct 2024 18:39:14 +0200 Subject: [PATCH] Prepare for climate.0.1.0 --- cmdlang-tests.opam | 2 +- cmdlang-to-climate.opam | 2 +- dune-project | 4 +- test/expect/arg_test.ml | 16 +- test/expect/test__applicative_operations.ml | 36 ++-- test/expect/test__cmd_name_with_underscore.ml | 3 +- test/expect/test__flag.ml | 114 ++++++------ test/expect/test__invalid_pos_opt.ml | 14 +- test/expect/test__named.ml | 102 +++++------ test/expect/test__negative_int_args.ml | 52 +++--- test/expect/test__param.ml | 162 +++++++++--------- test/expect/test__pos.ml | 72 ++++---- 12 files changed, 292 insertions(+), 287 deletions(-) diff --git a/cmdlang-tests.opam b/cmdlang-tests.opam index 3557503..4506c6b 100644 --- a/cmdlang-tests.opam +++ b/cmdlang-tests.opam @@ -13,7 +13,7 @@ depends: [ "ocamlformat" {with-dev-setup & = "0.26.2"} "base" {>= "v0.17" & < "v0.18"} "bisect_ppx" {with-dev-setup & >= "2.8.3"} - "climate" {= "0.0.1~preview-0.1"} + "climate" {>= "0.1.0~preview-0.1"} "cmdlang" {= version} "cmdlang-cmdliner-runner" {= version} "cmdlang-to-base" {= version} diff --git a/cmdlang-to-climate.opam b/cmdlang-to-climate.opam index 63f38ad..923c1a4 100644 --- a/cmdlang-to-climate.opam +++ b/cmdlang-to-climate.opam @@ -10,7 +10,7 @@ bug-reports: "https://github.com/mbarbin/cmdlang/issues" depends: [ "dune" {>= "3.16"} "ocaml" {>= "5.2"} - "climate" {= "0.0.1~preview-0.1"} + "climate" {>= "0.1.0~preview-0.1"} "cmdlang" {= version} "odoc" {with-doc} ] diff --git a/dune-project b/dune-project index 5fdc01f..ee5e399 100644 --- a/dune-project +++ b/dune-project @@ -134,7 +134,7 @@ (ocaml (>= 5.2)) (climate - (= 0.0.1~preview-0.1)) + (>= 0.1.0~preview-0.1)) (cmdlang (= :version)))) @@ -172,7 +172,7 @@ :with-dev-setup (>= 2.8.3))) (climate - (= 0.0.1~preview-0.1)) + (>= 0.1.0~preview-0.1)) (cmdlang (= :version)) (cmdlang-cmdliner-runner diff --git a/test/expect/arg_test.ml b/test/expect/arg_test.ml index c47e4df..9cdb6bb 100644 --- a/test/expect/arg_test.ml +++ b/test/expect/arg_test.ml @@ -78,7 +78,7 @@ let eval_climate t { Command_line.prog; args } = | Ok arg_parser -> (match let cmd = Climate.Command.singleton arg_parser in - Climate.Command.eval cmd { program = prog; args } + Climate.Command.eval cmd ~program_name:(Literal prog) args with | () -> () | exception e -> print_s [%sexp "Evaluation Raised", (e : Exn.t)] [@coverage off]) @@ -101,10 +101,14 @@ let eval_cmdliner t { Command_line.prog; args } = let eval_all t command_line = List.iter Backend.all ~f:(fun backend -> print_endline - (Printf.sprintf "----------------------------- %s" (Backend.to_string backend)); - match backend with - | Climate -> eval_climate t command_line - | Cmdliner -> eval_cmdliner t command_line - | Core_command -> eval_base t command_line); + (Printf.sprintf + "----------------------------------------------------- %s" + (Backend.to_string backend)); + (match backend with + | Climate -> eval_climate t command_line + | Cmdliner -> eval_cmdliner t command_line + | Core_command -> eval_base t command_line); + Stdlib.(flush stdout); + Stdlib.(flush stderr)); () ;; diff --git a/test/expect/test__applicative_operations.ml b/test/expect/test__applicative_operations.ml index 3ce6008..8b7ba1e 100644 --- a/test/expect/test__applicative_operations.ml +++ b/test/expect/test__applicative_operations.ml @@ -9,11 +9,11 @@ let%expect_test "const" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate hello - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command hello |}]; () @@ -30,31 +30,31 @@ let%expect_test "map" = Arg_test.eval_all test { prog = "test"; args = [ "0" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate (0) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner (0) - ----------------------------- Core_command + ----------------------------------------------------- Core_command (0) |}]; Arg_test.eval_all test { prog = "test"; args = [ "not-an-int" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate () - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner () - ----------------------------- Core_command + ----------------------------------------------------- Core_command () |}]; Arg_test.eval_all test { prog = "test"; args = [ "42" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate (42) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner (42) - ----------------------------- Core_command + ----------------------------------------------------- Core_command (42) |}]; () @@ -91,21 +91,21 @@ let%expect_test "apply" = Arg_test.eval_all test { prog = "test"; args = [ "succ"; "0" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate 1 - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner 1 - ----------------------------- Core_command + ----------------------------------------------------- Core_command 1 |}]; Arg_test.eval_all test { prog = "test"; args = [ "pred"; "42" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate 41 - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner 41 - ----------------------------- Core_command + ----------------------------------------------------- Core_command 41 |}]; () diff --git a/test/expect/test__cmd_name_with_underscore.ml b/test/expect/test__cmd_name_with_underscore.ml index 9090933..a255fa5 100644 --- a/test/expect/test__cmd_name_with_underscore.ml +++ b/test/expect/test__cmd_name_with_underscore.ml @@ -26,7 +26,8 @@ let%expect_test "climate" = (* In climate, subcommand names containing an underscore are valid. *) Climate.Command.eval (Cmdlang_to_climate.Translate.command group) - { program = "./main.exe"; args = [ "name_with_underscore" ] }; + ~program_name:(Literal "./main.exe") + [ "name_with_underscore" ]; [%expect {||}]; () ;; diff --git a/test/expect/test__flag.ml b/test/expect/test__flag.ml index 882f863..563e252 100644 --- a/test/expect/test__flag.ml +++ b/test/expect/test__flag.ml @@ -9,19 +9,19 @@ let%expect_test "flag" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; (* When full flags are provided, all backend agree and things work as expected. *) Arg_test.eval_all test { prog = "test"; args = [ "--print-hello" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello |}]; (* When the specification does not include an explicit one letter alias, none @@ -29,14 +29,14 @@ let%expect_test "flag" = Arg_test.eval_all test { prog = "test"; args = [ "-p" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" (Climate.Parse_error.E "Unknown argument name: -p")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: unknown option '-p'. Usage: test [--print-hello] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"unknown flag -p\")")) |}]; @@ -47,14 +47,14 @@ let%expect_test "flag" = Arg_test.eval_all test { prog = "test"; args = [ "-print-hello" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" (Climate.Parse_error.E "Unknown argument name: -p")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: unknown option '-p', did you mean '--print-hello'? Usage: test [--print-hello] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"unknown flag -print-hello\")")) |}]; @@ -64,11 +64,11 @@ let%expect_test "flag" = Arg_test.eval_all test { prog = "test"; args = [ "--print" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" (Climate.Parse_error.E "Unknown argument name: --print")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello |}]; () @@ -84,35 +84,35 @@ let%expect_test "1-letter-flag" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; (* One letter flags are expected to be supplied with a single dash. *) Arg_test.eval_all test { prog = "test"; args = [ "-p" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello |}]; (* One letter flags are not recognized with called with two dashes. All backend agree on that. *) Arg_test.eval_all test { prog = "test"; args = [ "--p" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Single-character names must only be specified with a single dash. \"--p\" is not allowed as it has two dashes but only one character.")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: unknown option '--p', did you mean '-p'? Usage: test [-p] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"unknown flag --p\")")) |}]; @@ -130,30 +130,30 @@ let%expect_test "1-letter-alias" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; (* When full flags are provided, all backend agree and things work as expected. *) Arg_test.eval_all test { prog = "test"; args = [ "--print-hello" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello |}]; (* The specification now includes an explicit one letter alias. *) Arg_test.eval_all test { prog = "test"; args = [ "-p" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello |}]; (* One letter flags may not be called with 2 dashes. However, since [cmdliner] @@ -163,13 +163,13 @@ let%expect_test "1-letter-alias" = Arg_test.eval_all test { prog = "test"; args = [ "--p" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Single-character names must only be specified with a single dash. \"--p\" is not allowed as it has two dashes but only one character.")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello |}]; () @@ -188,29 +188,29 @@ let%expect_test "ambiguous prefixes" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; (* When full flags are provided, all backend agree and things work as expected. *) Arg_test.eval_all test { prog = "test"; args = [ "--print-hello-you" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello You - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello You - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello You |}]; Arg_test.eval_all test { prog = "test"; args = [ "--print-hello-world" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; (* When the flags are supplied partially, the backend diverge. If the @@ -218,27 +218,27 @@ let%expect_test "ambiguous prefixes" = Arg_test.eval_all test { prog = "test"; args = [ "--print-hello-w" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Unknown argument name: --print-hello-w")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; (* When the prefix is ambiguous, it is rejected. *) Arg_test.eval_all test { prog = "test"; args = [ "--print-hello" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Unknown argument name: --print-hello")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: option '--print-hello' ambiguous and could be either '--print-hello-world' or '--print-hello-you' Usage: test [--print-hello-world] [--print-hello-you] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"flag --print-hello is an ambiguous prefix: --print-hello-world, --print-hello-you\")")) |}]; @@ -255,11 +255,11 @@ let%expect_test "flag_count" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ((count 0)) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner ((count 0)) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Translation Raised" ( "Flag_count not supported by core.command" ((names (count c)) (doc count)))) |}]; @@ -267,11 +267,11 @@ let%expect_test "flag_count" = Arg_test.eval_all test { prog = "test"; args = [ "--count"; "-c"; "-c" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ((count 3)) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner ((count 3)) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Translation Raised" ( "Flag_count not supported by core.command" ((names (count c)) (doc count)))) |}]; diff --git a/test/expect/test__invalid_pos_opt.ml b/test/expect/test__invalid_pos_opt.ml index d25b95b..2597e81 100644 --- a/test/expect/test__invalid_pos_opt.ml +++ b/test/expect/test__invalid_pos_opt.ml @@ -14,25 +14,25 @@ let%expect_test "invalid_pos_sequence" = Arg_test.eval_all test { prog = "test"; args = [ "A"; "B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ((a (A)) (b B)) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner ((a (A)) (b B)) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ((a (A)) (b B)) |}]; Arg_test.eval_all test { prog = "test"; args = [ "B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Missing required positional argument at position 1.")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: required argument STRING is missing Usage: test [OPTION]… [STRING] STRING Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" "missing anonymous argument: STRING") |}]; () @@ -57,7 +57,7 @@ let%expect_test "base" = let%expect_test "climate" = let cmd = Cmdlang_to_climate.Translate.command cmd in let run args = - match Climate.Command.eval cmd { program = "./main.exe"; args } with + match Climate.Command.eval cmd ~program_name:(Literal "./main.exe") args with | () -> () | exception e -> print_s [%sexp "Evaluation raised", (e : Exn.t)] in diff --git a/test/expect/test__named.ml b/test/expect/test__named.ml index d8d2e9d..5e3dc90 100644 --- a/test/expect/test__named.ml +++ b/test/expect/test__named.ml @@ -11,36 +11,36 @@ let%expect_test "named" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Missing required named argument: --who")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: required option --who is missing Usage: test [--who=WHO] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" "missing required flag: --who") |}]; Arg_test.eval_all test { prog = "test"; args = [ "--who"; "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; (* [climate] and [cmdliner] support the [--arg=VALUE] syntax. [core.command] does not. *) Arg_test.eval_all test { prog = "test"; args = [ "--who=You" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello You - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello You - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"unknown flag --who=You\")")) |}]; @@ -58,36 +58,36 @@ let%expect_test "1-letter-named" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Missing required named argument: -w")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: required option -w is missing Usage: test [-w WHO] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" "missing required flag: -w") |}]; Arg_test.eval_all test { prog = "test"; args = [ "-w"; "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; (* [climate] and [cmdliner] support the [-wVALUE] syntax. [core.command] does not. *) Arg_test.eval_all test { prog = "test"; args = [ "-wYou" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello You - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello You - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"unknown flag -wYou\")")) |}]; @@ -105,18 +105,18 @@ let%expect_test "named_multi" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; Arg_test.eval_all test { prog = "test"; args = [ "--who"; "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; Arg_test.eval_all @@ -126,15 +126,15 @@ let%expect_test "named_multi" = }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World Hello You Hello Me - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World Hello You Hello Me - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World Hello You Hello Me @@ -153,18 +153,18 @@ let%expect_test "named_opt" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; Arg_test.eval_all test { prog = "test"; args = [ "--who"; "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; () @@ -186,21 +186,21 @@ let%expect_test "named_with_default" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; Arg_test.eval_all test { prog = "test"; args = [ "--who"; "You" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello You - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello You - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello You |}]; () @@ -222,15 +222,15 @@ let%expect_test "named_with_default__comma_separated" = Arg_test.eval_all (test ()) { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello You Hello Me Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello You Hello Me Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello You Hello Me Hello World @@ -238,9 +238,9 @@ let%expect_test "named_with_default__comma_separated" = Arg_test.eval_all (test ~default:[] ()) { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; (* Empty values are currently treated inconsistently by the three translation+backend. In climate, you get a singleton made of the empty @@ -249,23 +249,23 @@ let%expect_test "named_with_default__comma_separated" = Arg_test.eval_all (test ()) { prog = "test"; args = [ "--who"; "" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse --who value \\\"\\\".\\n(Failure \\\"Command.Spec.Arg_type.comma_separated: empty list not allowed\\\")\")")) |}]; Arg_test.eval_all (test ()) { prog = "test"; args = [ "--who"; "Universe,Them Too" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello Universe Hello Them Too - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello Universe Hello Them Too - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello Universe Hello Them Too |}]; diff --git a/test/expect/test__negative_int_args.ml b/test/expect/test__negative_int_args.ml index acc4555..26865dc 100644 --- a/test/expect/test__negative_int_args.ml +++ b/test/expect/test__negative_int_args.ml @@ -16,21 +16,21 @@ let%expect_test "negative positional" = Arg_test.eval_all test { prog = "test"; args = [ "0" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate zero - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner zero - ----------------------------- Core_command + ----------------------------------------------------- Core_command zero |}]; Arg_test.eval_all test { prog = "test"; args = [ "+1" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate positive - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner positive - ----------------------------- Core_command + ----------------------------------------------------- Core_command positive |}]; (* All three backend agree, negative numbers are not supported as positional @@ -38,17 +38,17 @@ let%expect_test "negative positional" = Arg_test.eval_all test { prog = "test"; args = [ "-1" ] }; [%expect {| - ----------------------------- Climate - ("Evaluation Raised" (Climate.Parse_error.E "Unknown argument name: -1")) - ----------------------------- Cmdliner - test: unknown option '-1'. - Usage: test [OPTION]… INT - Try 'test --help' for more information. - ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command - ("Evaluation Failed" ( - "Command.Failed_to_parse_command_line(\"unknown flag -1\")")) - |}]; + ----------------------------------------------------- Climate + ("Evaluation Raised" (Climate.Parse_error.E "Unknown argument name: -1")) + ----------------------------------------------------- Cmdliner + test: unknown option '-1'. + Usage: test [OPTION]… INT + Try 'test --help' for more information. + ("Evaluation Failed" ((exit_code 124))) + ----------------------------------------------------- Core_command + ("Evaluation Failed" ( + "Command.Failed_to_parse_command_line(\"unknown flag -1\")")) + |}]; () ;; @@ -68,21 +68,21 @@ let%expect_test "negative named" = Arg_test.eval_all test { prog = "test"; args = [ "-n"; "0" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate zero - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner zero - ----------------------------- Core_command + ----------------------------------------------------- Core_command zero |}]; Arg_test.eval_all test { prog = "test"; args = [ "-n"; "+1" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate positive - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner positive - ----------------------------- Core_command + ----------------------------------------------------- Core_command positive |}]; (* When the arg is named, climate and core.command support negative values, @@ -90,14 +90,14 @@ let%expect_test "negative named" = Arg_test.eval_all test { prog = "test"; args = [ "-n"; "-1" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate negative - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: unknown option '-1'. Usage: test [-n INT] [OPTION]… Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command negative |}]; () diff --git a/test/expect/test__param.ml b/test/expect/test__param.ml index 05e6f57..7c16bf3 100644 --- a/test/expect/test__param.ml +++ b/test/expect/test__param.ml @@ -11,11 +11,11 @@ let%expect_test "string" = Arg_test.eval_all t1 { prog = "test"; args = [ "hello" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate hello - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner hello - ----------------------------- Core_command + ----------------------------------------------------- Core_command hello |}]; () @@ -26,26 +26,26 @@ let%expect_test "int" = Arg_test.eval_all t1 { prog = "test"; args = [ "1_234" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate 1_234 - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner 1_234 - ----------------------------- Core_command + ----------------------------------------------------- Core_command 1_234 |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "not-an-int" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"not-an-int\" (not an int)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: INT argument: invalid value 'not-an-int', expected an integer Usage: test [OPTION]… INT Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse INT value \\\"not-an-int\\\"\\n(Failure \\\"Int.of_string: \\\\\\\"not-an-int\\\\\\\"\\\")\")")) |}]; @@ -57,37 +57,37 @@ let%expect_test "float" = Arg_test.eval_all t1 { prog = "test"; args = [ "1_234" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate 1234. - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner 1234. - ----------------------------- Core_command + ----------------------------------------------------- Core_command 1234. |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "1.234" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate 1.234 - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner 1.234 - ----------------------------- Core_command + ----------------------------------------------------- Core_command 1.234 |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "not-an-number" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"not-an-number\" (not an float)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: FLOAT argument: invalid value 'not-an-number', expected a floating point number Usage: test [OPTION]… FLOAT Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse FLOAT value \\\"not-an-number\\\"\\n(Invalid_argument \\\"Float.of_string not-an-number\\\")\")")) |}]; @@ -99,36 +99,36 @@ let%expect_test "bool" = Arg_test.eval_all t1 { prog = "test"; args = [ "true" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate true - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner true - ----------------------------- Core_command + ----------------------------------------------------- Core_command true |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "false" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate false - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner false - ----------------------------- Core_command + ----------------------------------------------------- Core_command false |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "not-a-bool" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"not-a-bool\" (not an bool)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: BOOL argument: invalid value 'not-a-bool', either 'true' or 'false' Usage: test [OPTION]… BOOL Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse BOOL value \\\"not-a-bool\\\"\\n(Failure \\\"valid arguments: {false,true}\\\")\")")) |}]; @@ -146,25 +146,25 @@ let%expect_test "file" = Arg_test.eval_all t1 { prog = "test"; args = [ "foo.txt" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate foo.txt - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: FILE argument: no 'foo.txt' file or directory Usage: test [OPTION]… FILE Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command foo.txt |}]; save_file ~path:"foo.txt" ~contents:"Foo"; Arg_test.eval_all t1 { prog = "test"; args = [ "foo.txt" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate foo.txt - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner foo.txt - ----------------------------- Core_command + ----------------------------------------------------- Core_command foo.txt |}] ;; @@ -185,36 +185,36 @@ let%expect_test "assoc" = Arg_test.eval_all t1 { prog = "test"; args = [ "A" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate A - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner A - ----------------------------- Core_command + ----------------------------------------------------- Core_command A |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate B - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner B - ----------------------------- Core_command + ----------------------------------------------------- Core_command B |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "Not_an_e" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"Not_an_e\" (valid values are: A, B)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: invalid value 'Not_an_e', expected either 'A' or 'B' Usage: test [OPTION]… ARG Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse VAL value \\\"Not_an_e\\\"\\n(Failure \\\"valid arguments: {A,B}\\\")\")")) |}]; @@ -238,36 +238,36 @@ let%expect_test "enumerated" = Arg_test.eval_all t1 { prog = "test"; args = [ "A" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate A - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner A - ----------------------------- Core_command + ----------------------------------------------------- Core_command A |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate B - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner B - ----------------------------- Core_command + ----------------------------------------------------- Core_command B |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "Not_an_e" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"Not_an_e\" (valid values are: A, B)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: invalid value 'Not_an_e', expected either 'A' or 'B' Usage: test [OPTION]… ARG Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse VAL value \\\"Not_an_e\\\"\\n(Failure \\\"valid arguments: {A,B}\\\")\")")) |}]; @@ -291,11 +291,11 @@ let%expect_test "stringable" = Arg_test.eval_all t1 { prog = "test"; args = [ "my-id" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate my-id - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner my-id - ----------------------------- Core_command + ----------------------------------------------------- Core_command my-id |}]; () @@ -326,46 +326,46 @@ let%expect_test "validated_string" = Arg_test.eval_all t1 { prog = "test"; args = [ "A" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate A - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner A - ----------------------------- Core_command + ----------------------------------------------------- Core_command A |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate B - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner B - ----------------------------- Core_command + ----------------------------------------------------- Core_command B |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "Id_size8" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Id_size8 - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Id_size8 - ----------------------------- Core_command + ----------------------------------------------------- Core_command Id_size8 |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "Id_of_size12" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid id")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: invalid id Usage: test [OPTION]… ARG Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse VAL value \\\"Id_of_size12\\\"\\n(Msg \\\"invalid id\\\")\")")) |}]; @@ -393,31 +393,31 @@ let%expect_test "comma_separated" = Arg_test.eval_all t1 { prog = "test"; args = [ "A" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate A - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner A - ----------------------------- Core_command + ----------------------------------------------------- Core_command A |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate B - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner B - ----------------------------- Core_command + ----------------------------------------------------- Core_command B |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "A,B" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate A,B - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner A,B - ----------------------------- Core_command + ----------------------------------------------------- Core_command A,B |}]; (* At the moment the translation does not consistently determine whether the @@ -426,30 +426,30 @@ let%expect_test "comma_separated" = Arg_test.eval_all t1 { prog = "test"; args = [ "" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"\" (valid values are: A, B)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse VAL value \\\"\\\"\\n(Failure \\\"Command.Spec.Arg_type.comma_separated: empty list not allowed\\\")\")")) |}]; Arg_test.eval_all t1 { prog = "test"; args = [ "Not_an_e" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Failed to parse the argument at position 0: invalid value: \"Not_an_e\" (valid values are: A, B)")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: invalid element in list ('Not_an_e'): invalid value 'Not_an_e', expected either 'A' or 'B' Usage: test [OPTION]… ARG Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" ( "Command.Failed_to_parse_command_line(\"failed to parse VAL value \\\"Not_an_e\\\"\\n(Failure \\\"valid arguments: {A,B}\\\")\")")) |}]; diff --git a/test/expect/test__pos.ml b/test/expect/test__pos.ml index 7306e9d..6665e7f 100644 --- a/test/expect/test__pos.ml +++ b/test/expect/test__pos.ml @@ -11,25 +11,25 @@ let%expect_test "pos" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Parse_error.E "Missing required positional argument at position 0.")) - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner test: required argument WHO is missing Usage: test [OPTION]… WHO Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Evaluation Failed" "missing anonymous argument: WHO") |}]; Arg_test.eval_all test { prog = "test"; args = [ "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; () @@ -49,16 +49,16 @@ let%expect_test "skipping-pos" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Spec_error.E "Attempted to declare a parser with a gap in its positional arguments. No parser would interpret the argument at position 0 but there is a parser for at least one argument at a higher position.")) - ----------------------------- Cmdliner + Attempted to declare a parser with a gap in its positional arguments. No parser would interpret the argument at position 0 but there is a parser for at least one argument at a higher position.----------------------------------------------------- Cmdliner test: required argument WHO is missing Usage: test [OPTION]… WHO Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Translation Raised" ( "Positional arguments must be supplied in consecutive order" ((expected 0) @@ -67,16 +67,16 @@ let%expect_test "skipping-pos" = Arg_test.eval_all test { prog = "test"; args = [ "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Spec_error.E "Attempted to declare a parser with a gap in its positional arguments. No parser would interpret the argument at position 0 but there is a parser for at least one argument at a higher position.")) - ----------------------------- Cmdliner + Attempted to declare a parser with a gap in its positional arguments. No parser would interpret the argument at position 0 but there is a parser for at least one argument at a higher position.----------------------------------------------------- Cmdliner test: required argument WHO is missing Usage: test [OPTION]… WHO Try 'test --help' for more information. ("Evaluation Failed" ((exit_code 124))) - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Translation Raised" ( "Positional arguments must be supplied in consecutive order" ((expected 0) @@ -85,13 +85,13 @@ let%expect_test "skipping-pos" = Arg_test.eval_all test { prog = "test"; args = [ "Big"; "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate ("Evaluation Raised" ( Climate.Spec_error.E "Attempted to declare a parser with a gap in its positional arguments. No parser would interpret the argument at position 0 but there is a parser for at least one argument at a higher position.")) - ----------------------------- Cmdliner + Attempted to declare a parser with a gap in its positional arguments. No parser would interpret the argument at position 0 but there is a parser for at least one argument at a higher position.----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command ("Translation Raised" ( "Positional arguments must be supplied in consecutive order" ((expected 0) @@ -111,18 +111,18 @@ let%expect_test "pos_opt" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; Arg_test.eval_all test { prog = "test"; args = [ "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; () @@ -144,21 +144,21 @@ let%expect_test "pos_with_default" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; Arg_test.eval_all test { prog = "test"; args = [ "You" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello You - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello You - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello You |}]; () @@ -175,32 +175,32 @@ let%expect_test "pos_all" = Arg_test.eval_all test { prog = "test"; args = [] }; [%expect {| - ----------------------------- Climate - ----------------------------- Cmdliner - ----------------------------- Core_command + ----------------------------------------------------- Climate + ----------------------------------------------------- Cmdliner + ----------------------------------------------------- Core_command |}]; Arg_test.eval_all test { prog = "test"; args = [ "World" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World |}]; Arg_test.eval_all test { prog = "test"; args = [ "World"; "You"; "Me" ] }; [%expect {| - ----------------------------- Climate + ----------------------------------------------------- Climate Hello World Hello You Hello Me - ----------------------------- Cmdliner + ----------------------------------------------------- Cmdliner Hello World Hello You Hello Me - ----------------------------- Core_command + ----------------------------------------------------- Core_command Hello World Hello You Hello Me