Skip to content

Commit

Permalink
Don't generate --no-option for single char option names
Browse files Browse the repository at this point in the history
  • Loading branch information
Julow committed Oct 9, 2019
1 parent 04ae524 commit 99f0e4e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ocamlformat-help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,7 @@ OPTIONS
--no-comment-check
Unset comment-check.

--no-quiet, --no-q
--no-quiet
Unset quiet.

--no-version-check
Expand Down
5 changes: 4 additions & 1 deletion src/Config_option.ml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,10 @@ module Make (C : CONFIG) = struct
?(allow_inline = Poly.(section = `Formatting)) ?(deprecated = false)
update get_value =
let open Cmdliner in
let invert_names = List.map names ~f:(fun n -> "no-" ^ n) in
let invert_names =
List.filter_map names ~f:(fun n ->
if String.length n = 1 then None else Some ("no-" ^ n))
in
let doc =
generated_flag_doc ~allow_inline ~doc ~section ~default ~deprecated
in
Expand Down

0 comments on commit 99f0e4e

Please sign in to comment.