Closed larskuhtz closed 5 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!
I added --version
in #54
I have no knowledge about alternative Haskell compilers whether they can build hasktags and whether they will break by this patch.
Closed by #54.
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 useSetup.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.