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 --numeric-version as default #9

Closed
pjonsson opened this issue Jul 10, 2014 · 4 comments
Closed

Add --numeric-version as default #9

pjonsson opened this issue Jul 10, 2014 · 4 comments

Comments

@pjonsson
Copy link

HLint is my use case for this feature request, but I think the feature is general enough to sit in command line parsing libraries.

Cabal supports the flag --numeric-version which is convenient for version detection/comparison in scripts/tools. I looked around in the source but I don't see any obvious ways of adding this flag without breaking the current API.

Can you either sketch how to cause the least breakage and I can prepare a patch, or add support for the flag?

@ndmitchell
Copy link
Owner

The feature doesn't need adding to the Explicit stuff at all, since there you code up your own --version string. For the Implicit stuff I would add cmdArgsNumericVersion to that type, then follow the pattern of summary to add a new numericVersion annotation. Then people can write &= numericVersion "0.0.4" and their app will support--numeric-version`. I don't foresee that causing any breakage.

@pjonsson
Copy link
Author

Do you see any way to encourage people to add that annotation, besides documenting it properly?

@ndmitchell
Copy link
Owner

The alternative is to take the summary annotation and look for things that look plausibly version shaped. I'd be happy with that.

@ndmitchell
Copy link
Owner

Added, and I checked it works with HLint.

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

2 participants