Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for argument with = #2

Merged
merged 13 commits into from
Feb 4, 2025
Merged

Add support for argument with = #2

merged 13 commits into from
Feb 4, 2025

Conversation

sim642
Copy link
Owner

@sim642 sim642 commented Jan 29, 2025

Alternative for #1.

TODO

  • Add option to autocomplete =.
  • Fix TODO about splitting while skipping over arguments.

@sim642 sim642 added the enhancement New feature or request label Jan 29, 2025
@sim642 sim642 self-assigned this Jan 29, 2025
@sim642 sim642 marked this pull request as ready for review January 29, 2025 19:51
@sim642
Copy link
Owner Author

sim642 commented Feb 1, 2025

@rmonat Could you try this now?
I adapted the demo-completion.sh script to additionally work around bash's special features such that the OCaml side gets arguments in the expected way which matches the unit tests.
Depending on your preference, you might want to use the optional prefer_getopt_long argument.

@rmonat
Copy link

rmonat commented Feb 3, 2025

@rmonat Could you try this now? I adapted the demo-completion.sh script to additionally work around bash's special features such that the OCaml side gets arguments in the expected way which matches the unit tests. Depending on your preference, you might want to use the optional prefer_getopt_long argument.

@sim642 that's perfect, thanks a lot for taking the time to look into this and designing a clean solution!

@sim642 sim642 merged commit e2b6359 into master Feb 4, 2025
30 checks passed
sim642 added a commit to sim642/opam-repository that referenced this pull request Feb 4, 2025
CHANGES:

* Add support for `getopt_long` style arguments with `=` (sim642/ocaml-arg-complete#2).
@sim642
Copy link
Owner Author

sim642 commented Feb 5, 2025

This is now merged to opam-repository: ocaml/opam-repository#27364.

@rmonat
Copy link

rmonat commented Feb 5, 2025

This is now merged to opam-repository: ocaml/opam-repository#27364.

Great, thanks a lot @sim642!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants