Uses Git to produce the output so it can't fall out of date. Ideally it'd conditionally append "-dirty" as well, but that's not currently supported by the library and my own attempt was flaky.
$ git switch version-opt
$ cabal run -- intlc --version
v0.7.0-12-g8624452
$ git tag v0.8.0
$ cabal clean # Cabal doesn't know we need to rebuild. Naturally won't be an issue in CI.
$ cabal run -- intlc --version
v0.8.0
$ touch foo && git add foo && git commit
$ cabal clean
$ cabal run -- intlc --version
v0.8.0-1-g06fd894
Closes #98.
Follows the CLIG idiom/suggestion of
--version
.Uses Git to produce the output so it can't fall out of date. Ideally it'd conditionally append "-dirty" as well, but that's not currently supported by the library and my own attempt was flaky.