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

[Ftr] Ability to extend type presets, like :file for conforming the arg to File #157

Open
bartkl opened this issue Sep 7, 2022 · 0 comments

Comments

@bartkl
Copy link

bartkl commented Sep 7, 2022

Is your feature request related to a problem? Please describe.
The current presets are nice, but I would like to be able to extend them.

Describe the solution you'd like
My current use case is getting a file name from the CLI, and I would like to specify this to be of :type :file. This :file preset is what I would like to be able to add, so that this argument will be parsed as File object or give an error. Of course, a general solution is desired for extending types.

Describe alternatives you've considered
I looked at the cli-matic source code to try and figure something out myself. But it seems it's relatively hard to extend this. Writing a preset function is easy, but you then have to update presets/known-presets and, the more cumbersome, ::type spec. And perhaps more, I'm not entirely confident I understood it all.

Version / Platform

$ java --version
openjdk 11.0.11 2021-04-20
OpenJDK Runtime Environment 18.9 (build 11.0.11+9)
OpenJDK 64-Bit Server VM 18.9 (build 11.0.11+9, mixed mode)
$ clj --version
Clojure CLI version 1.11.1.1113
$ grep cli-matic project.clj 
[cli-matic "0.5.3"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant