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

dev: explore making command line parsing easier to adapt and maintain #77

Closed
lread opened this issue Aug 2, 2024 · 0 comments · Fixed by #80
Closed

dev: explore making command line parsing easier to adapt and maintain #77

lread opened this issue Aug 2, 2024 · 0 comments · Fixed by #80
Milestone

Comments

@lread
Copy link
Contributor

lread commented Aug 2, 2024

Currently

Clj-watson employs cli-matic to specify and parse its command line options.

But..

Cli-matic is good, but I think babashka.cli will likely be a better fit.

They both support specifying your command line, but babashka.cli is more of a toolbox than just a DSL and offers more flexibility:

Consideration

Clj-watson explicitly supports clojure tool -T usage.
At the very least, we need to retain any existing -T niceties.
See #67 (comment)

Next Steps

I'll explore this idea locally, and if it all is good, follow up with a PR.

lread added a commit to lread/clj-watson that referenced this issue Aug 3, 2024
When running via -X or -T:
- args are now validated
- benefits from rich bb cli coercion support
- usage help shows using keyword :arg syntax

When running via -M:
- preserved existing behaviour
- support more coercions
- usage help shows using cli -arg syntax

General:
- Narrower, easier to read usage help
- Options relating only to dependency-check strategy are now grouped
under their own heading
- Some rewording/rewriting of descriptions for clarity
- Command line error styled in red for visibility
- Support for aligning multi-line argument descriptions
- File options fail fast if file does not exist
- More coercions to keywords happen at command parse time instead of
within code. Code adjusted appropriately.

Closes clj-holmes#77
@seancorfield seancorfield added this to the 6.0 milestone Aug 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants