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,
|
PackageVersion,
|
||||||
VersionString,
|
VersionString,
|
||||||
packageversion,
|
packageversion,
|
||||||
|
packagemajorversion,
|
||||||
progname,
|
progname,
|
||||||
versionStringWith,
|
versionStringWith,
|
||||||
)
|
)
|
||||||
@ -18,6 +19,8 @@ import System.Info (os, arch)
|
|||||||
import Data.List (intercalate)
|
import Data.List (intercalate)
|
||||||
import Data.Maybe (fromMaybe)
|
import Data.Maybe (fromMaybe)
|
||||||
|
|
||||||
|
import Hledger.Utils (splitAtElement)
|
||||||
|
|
||||||
type ProgramName = String
|
type ProgramName = String
|
||||||
type PackageVersion = String
|
type PackageVersion = String
|
||||||
type VersionString = String
|
type VersionString = String
|
||||||
@ -32,6 +35,10 @@ packageversion =
|
|||||||
""
|
""
|
||||||
#endif
|
#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.
|
-- | The name of this package's main executable.
|
||||||
progname :: ProgramName
|
progname :: ProgramName
|
||||||
progname = "hledger"
|
progname = "hledger"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user