ocaml / omd

extensible Markdown library and tool in "pure OCaml"
ISC License
156 stars 45 forks source link

add `--version` flag to cli (closes #253) #264

Closed ghost closed 2 years ago

ghost commented 2 years ago

See https://github.com/ocaml/omd/issues/253.

This (currently draft) PR adds a --version flag to the omd CLI program. It's using the dune-build-info library to extract the version from dune-project to avoid needing another place to track the version.

I'm open to feedback here, because on the one hand this seems convenient (i.e. not having to re-define the version in code since it's already in dune-project) but on the other it might be preferable to keep this library dependency-free.

Changes:

shonfeder commented 2 years ago

Thanks, @EllipticCrab!

I don't have any problem with adding some light weight and useful additional dependencies. In this particular case, I could go either way: on the one hand, it is definitely easier than having to maintain the version in two separate places. On the other hand, that's quite lightweight maintenance. It's a toss up for me :)

Let's see if @sonologico has any strong feelings one way or the other here.

I'll be able to give a proper review later today or tomorrow, but on a superficial skim the changes here look great!

ghost commented 2 years ago

Sweet! Just pushed up the changes to the README.md and changed from draft to open. My first contribution to the OCaml ecosystem :-) Thanks!

Rendered README for convenience

shonfeder commented 2 years ago

Thanks again!