Skip to content

Commit

Permalink
Try pos args left to right when parsing command line
Browse files Browse the repository at this point in the history
This doesn't affect how arguments are evaluated as each pos arg parse
only looks at the own range of argv but it does affect which arg's
completion is going to be used.
  • Loading branch information
Andrey Popp committed Jun 9, 2024
1 parent 5bebf33 commit d7780c3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmdliner_cline.ml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ let arg_info_indexes args =
their arg_info, a list with all arg_info for positional arguments and
a cmdline mapping each arg_info to an empty [arg]. *)
let rec loop optidx posidx cl = function
| [] -> optidx, posidx, cl
| [] -> optidx, List.rev posidx, cl
| a :: l ->
match Cmdliner_info.Arg.is_pos a with
| true -> loop optidx (a :: posidx) (Amap.add a (P []) cl) l
Expand Down

0 comments on commit d7780c3

Please sign in to comment.