File tree Expand file tree Collapse file tree 3 files changed +15
-3
lines changed
Expand file tree Collapse file tree 3 files changed +15
-3
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## Unreleased
4+
5+ ### Changed
6+
7+ - Quote some values in error messages (#24 )
8+
39## 0.8.4
410
511### Changed
Original file line number Diff line number Diff line change @@ -93,20 +93,20 @@ module Parse_error = struct
9393 | None -> sprintf " Failed to parse the argument: %s" message)
9494 | Too_many_positional_arguments { max = 0 ; first_excess_argument } ->
9595 sprintf
96- " This command does not accept any positional arguments. First excess argument: %s "
96+ " This command does not accept any positional arguments. First excess argument: %S "
9797 first_excess_argument
9898 | Too_many_positional_arguments { max; first_excess_argument } ->
9999 sprintf
100100 " Too many positional arguments. At most %d positional arguments may be passed. \
101- First excess argument: %s "
101+ First excess argument: %S "
102102 max
103103 first_excess_argument
104104 | Invalid_char_in_argument_name { attempted_argument_name; invalid_char } ->
105105 sprintf
106106 " Invalid character %C in argument name %S"
107107 invalid_char
108108 attempted_argument_name
109- | No_such_subcommand subcommand -> sprintf " No such subcommand: %s " subcommand
109+ | No_such_subcommand subcommand -> sprintf " No such subcommand: %S " subcommand
110110 ;;
111111
112112 let exit_code = 124
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ let%expect_test "positional args passed to command with no positional args" =
1212 {| This command does not accept any positional arguments. First excess argument : foo |}]
1313;;
1414
15+ let % expect_test " empty string passed to command with no positional args" =
16+ run (Command. singleton (Arg_parser. const () )) [ " " ];
17+ [% expect
18+ {| This command does not accept any positional arguments. First excess argument : foo |}]
19+ ;;
20+
1521let % expect_test " positional args passed to command with no positional args" =
1622 let term = Arg_parser. (pos_req 0 string ) in
1723 run (Command. singleton term) [ " foo" ; " bar" ; " baz" ];
You can’t perform that action at this time.
0 commit comments