Skip to content

Commit cbe0f7b

Browse files
committed
Figure out or own version
1 parent af54fd0 commit cbe0f7b

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.ghci

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
:set -isrc -itests -idraft
1+
:set -isrc -itests -idist/build/autogen

src/Main.hs

+6-1
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ module Main
66

77

88
--------------------------------------------------------------------------------
9+
import Data.List (intercalate)
910
import Data.Maybe (listToMaybe)
11+
import Data.Version (Version(..))
1012
import System.Console.CmdArgs
1113

1214

1315
--------------------------------------------------------------------------------
16+
import Paths_stylish_haskell (version)
1417
import StylishHaskell
1518
import StylishHaskell.Config
1619

@@ -27,7 +30,9 @@ stylishArgs :: StylishArgs
2730
stylishArgs = StylishArgs
2831
{ config = Nothing &= typFile &= help "Configuration file"
2932
, files = [] &= typFile &= args
30-
} &= summary "stylish-haskell"
33+
} &= summary ("stylish-haskell-" ++ versionString version)
34+
where
35+
versionString = intercalate "." . map show . versionBranch
3136

3237

3338
--------------------------------------------------------------------------------

stylish-haskell.cabal

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Executable stylish-haskell
2424
Main-is: Main.hs
2525

2626
Other-modules:
27+
Paths_stylish_haskell
2728
StylishHaskell
2829
StylishHaskell.Block
2930
StylishHaskell.Config

0 commit comments

Comments
 (0)