File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55### Fixed
66
77- Fix alignment of doc text of positional arguments (#21 )
8+ - Print repeated positional argument docs below fixed positionalargument docs
89
910## 0.8.2
1011
Original file line number Diff line number Diff line change @@ -201,20 +201,24 @@ module Positional_args = struct
201201
202202 let to_print_section { fixed; repeated } =
203203 let entries =
204- List. map fixed ~f: (fun { Command_doc_spec.Positional_arg. value; doc } ->
205- { Print.Entry. names = Print.Names. empty
206- ; value = Some value
207- ; doc
208- ; repeated = false
209- })
210- |> List. append
211- (Option. map repeated ~f: (fun { Command_doc_spec.Positional_arg. value; doc } ->
212- { Print.Entry. names = Print.Names. empty
213- ; value = Some value
214- ; doc
215- ; repeated = true
216- })
217- |> Option. to_list)
204+ let fixed =
205+ List. map fixed ~f: (fun { Command_doc_spec.Positional_arg. value; doc } ->
206+ { Print.Entry. names = Print.Names. empty
207+ ; value = Some value
208+ ; doc
209+ ; repeated = false
210+ })
211+ in
212+ let repeated =
213+ Option. map repeated ~f: (fun { Command_doc_spec.Positional_arg. value; doc } ->
214+ { Print.Entry. names = Print.Names. empty
215+ ; value = Some value
216+ ; doc
217+ ; repeated = true
218+ })
219+ |> Option. to_list
220+ in
221+ fixed @ repeated
218222 in
219223 { Print.Section. section_heading = " Arguments:" ; entries }
220224 ;;
Original file line number Diff line number Diff line change @@ -462,9 +462,9 @@ let%expect_test "positional arguments" =
462462 Usage : foo.exe [OPTION ]… < FIRST > < SECOND > [REST ]…
463463
464464 Arguments :
465- [REST ]... rest doc
466465 < FIRST > first doc
467466 < SECOND > second doc
467+ [REST ]... rest doc
468468
469469 Options :
470470 - h, -- help Show this help message.
You can’t perform that action at this time.
0 commit comments