Permalink
Browse files

Figure out or own version

  • Loading branch information...
1 parent af54fd0 commit cbe0f7bc5ddae7f546e525394c8095062e11ef0f @jaspervdj committed Jun 5, 2012
Showing with 8 additions and 2 deletions.
  1. +1 −1 .ghci
  2. +6 −1 src/Main.hs
  3. +1 −0 stylish-haskell.cabal
View
@@ -1 +1 @@
-:set -isrc -itests -idraft
+:set -isrc -itests -idist/build/autogen
View
@@ -6,11 +6,14 @@ module Main
--------------------------------------------------------------------------------
+import Data.List (intercalate)
import Data.Maybe (listToMaybe)
+import Data.Version (Version(..))
import System.Console.CmdArgs
--------------------------------------------------------------------------------
+import Paths_stylish_haskell (version)
import StylishHaskell
import StylishHaskell.Config
@@ -27,7 +30,9 @@ stylishArgs :: StylishArgs
stylishArgs = StylishArgs
{ config = Nothing &= typFile &= help "Configuration file"
, files = [] &= typFile &= args
- } &= summary "stylish-haskell"
+ } &= summary ("stylish-haskell-" ++ versionString version)
+ where
+ versionString = intercalate "." . map show . versionBranch
--------------------------------------------------------------------------------
@@ -24,6 +24,7 @@ Executable stylish-haskell
Main-is: Main.hs
Other-modules:
+ Paths_stylish_haskell
StylishHaskell
StylishHaskell.Block
StylishHaskell.Config

0 comments on commit cbe0f7b

Please sign in to comment.