MarcWeber / hasktags

Produces ctags "tags" and etags "TAGS" files for Haskell programs
Other
127 stars 32 forks source link

Add a --version flag #49

Closed larskuhtz closed 5 years ago

larskuhtz commented 6 years ago

The macro CURRENT_PACKAGE_VERSION is available since cabal-2.0. With this PR, when compiled with older cabal versions the string "unknown" is printed. It is possible to use Setup.hs to retrieve the package version for older versions of cabal, but I am not sure if it is worth the effort. Alternatively, the flag could be hidden for older cabal version.

jhenahan commented 6 years ago

I intend to replace the current CLI with something like optparse-applicative in a future release, and I'll likely use

import Data.Version (showVersion)
import Paths_hasktags (version)

and then showVersion version to interpolate the current version of the executable. I think that should get us support for all extant Cabal versions, and we won't have to add any more CPP than necessary. Happy to merge this if you'd like to reformulate it using showVersion, of course. Thanks for your contribution!

tvestelind commented 6 years ago

I added --version in #54

MarcWeber commented 6 years ago

I have no knowledge about alternative Haskell compilers whether they can build hasktags and whether they will break by this patch.

jhenahan commented 5 years ago

Closed by #54.