to Hledger.Cli. Since the git hash changes whenever any file in the repository changes, this means Hledger.Cli.Version needs to be recompiled all the time. Since it is at the bottom of the module hierarchy, this means that the whole hledger package needs to be recompiled. We instead move the TemplateHaskell splice to one of the top modules, so much less needs to be recompiled. Note: Ghc seems to be able to get out of most of the recompiling a lot of the time (due to caching?), but this makes things more reliable.
40 lines
1.3 KiB
Haskell
40 lines
1.3 KiB
Haskell
{-# LANGUAGE TemplateHaskell #-}
|
|
{-|
|
|
|
|
Hledger.Cli re-exports the options, utilities and commands provided by
|
|
the hledger command-line program. This module also aggregates the
|
|
built-in unit tests defined throughout hledger and hledger-lib, and
|
|
adds some more which are easier to define here.
|
|
|
|
-}
|
|
|
|
module Hledger.Cli (
|
|
module Hledger.Cli.CliOptions,
|
|
module Hledger.Cli.Commands,
|
|
module Hledger.Cli.DocFiles,
|
|
module Hledger.Cli.Utils,
|
|
module Hledger.Cli.Version,
|
|
module Hledger,
|
|
module System.Console.CmdArgs.Explicit,
|
|
prognameandversion,
|
|
versionStringForProgname
|
|
)
|
|
where
|
|
|
|
import GitHash (tGitInfoCwdTry)
|
|
import System.Console.CmdArgs.Explicit hiding (Name) -- don't clash with hledger-ui
|
|
|
|
import Hledger
|
|
import Hledger.Cli.CliOptions
|
|
import Hledger.Cli.Commands
|
|
import Hledger.Cli.DocFiles
|
|
import Hledger.Cli.Utils
|
|
import Hledger.Cli.Version
|
|
|
|
-- | The program name and the best version information we can obtain
|
|
-- from git describe or build variables.
|
|
prognameandversion = versionStringForProgname progname
|
|
versionStringForProgname = versionStringFor $$tGitInfoCwdTry
|
|
|
|
-- unit tests (tests_Hledger_Cli) are defined in Hledger.Cli.Commands
|