imp:cli:Hledger.Cli.Version: export packagemajorversion
This commit is contained in:
parent
b5bf0cbdb9
commit
605b3d6b94
@ -8,6 +8,7 @@ module Hledger.Cli.Version (
|
||||
PackageVersion,
|
||||
VersionString,
|
||||
packageversion,
|
||||
packagemajorversion,
|
||||
progname,
|
||||
versionStringWith,
|
||||
)
|
||||
@ -18,6 +19,8 @@ import System.Info (os, arch)
|
||||
import Data.List (intercalate)
|
||||
import Data.Maybe (fromMaybe)
|
||||
|
||||
import Hledger.Utils (splitAtElement)
|
||||
|
||||
type ProgramName = String
|
||||
type PackageVersion = String
|
||||
type VersionString = String
|
||||
@ -32,6 +35,10 @@ packageversion =
|
||||
""
|
||||
#endif
|
||||
|
||||
-- | Just the first 1-2 components of packageversion.
|
||||
packagemajorversion :: PackageVersion
|
||||
packagemajorversion = intercalate "." $ take 2 $ splitAtElement '.' packageversion
|
||||
|
||||
-- | The name of this package's main executable.
|
||||
progname :: ProgramName
|
||||
progname = "hledger"
|
||||
|
||||
Loading…
Reference in New Issue
Block a user