lud / mix_version

A simple version tool for Elixir
https://hex.pm/packages/mix_version
MIT License
1 stars 1 forks source link

No annotation even when I specify `annotation: true` in the project config. #2

Closed whmountains closed 8 months ago

whmountains commented 8 months ago

Steps to reproduce:

What seems to be happening is that CLIMate returns false instead of nil when the annotate option is not specified, which overrides anything specified in the project.

lud commented 8 months ago

Hi,

Thank you for the bug report.

Indeed, CliMate defaults to false when reading boolean options. That was a bad choice, I don't remember why. I'll have to update climate to v3 to remove that.

whmountains commented 8 months ago

Great! Locally I rewrote it to use OptionParser, but climate does have a lot more features in things like automatic printing of usage. One thing you might consider is changing climate to use OptionParser under the hood for actual parsing of the arguments, while exposing a nicer API.

lud commented 8 months ago

CliMate is using OptionParser.

It was forcing booleans to default to false, for whatever reason. I just removed that. You can now use mix_version 2.2.1 and it should work as intended.

Tell me if it works for you :)

whmountains commented 8 months ago

Oh! Does that mean the negation flags work too? For example would --no-anotate disable annotations when the mix config has annotate: true?

whmountains commented 8 months ago

I just installed the latest version and it works great.

As an aside, digging through your codebase to find the issue was a pleasure. Really clean and easy to understand.

Thank you for the the quick fix and excellent tool.

lud commented 8 months ago

Yes it would, i tested all -a, --no-annotation and no option with both [annotate: true] and [annotate: false]

lud commented 8 months ago

Thank you for your kind words!