Skip to content

Commit

Permalink
Add a version command
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak committed Oct 29, 2016
1 parent 24edd06 commit 44405f2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions executable/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import qualified Data.Aeson.TH as Aeson
import qualified Data.Binary.Get as Binary
import qualified Data.Binary.Put as Binary
import qualified Data.ByteString.Lazy as ByteString
import qualified Data.Version as Version
import qualified Language.Haskell.TH as TH
import qualified System.Environment as Environment

Expand All @@ -25,6 +26,7 @@ main = do
mainWithArgs :: [String] -> IO ()
mainWithArgs args =
case args of
["version"] -> putStrLn (Version.showVersion version)
"decode":files -> do
(getInput, putOutput) <- getIO files
input <- getInput
Expand Down
1 change: 1 addition & 0 deletions library/Rattletrap.hs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import Rattletrap.ReplicationValue as Export
import Rattletrap.Text as Export
import Rattletrap.Utility as Export
import Rattletrap.Vector as Export
import Rattletrap.Version as Export
import Rattletrap.Word32 as Export
import Rattletrap.Word64 as Export
import Rattletrap.Word8 as Export
7 changes: 7 additions & 0 deletions library/Rattletrap/Version.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module Rattletrap.Version where

import qualified Data.Version as Version
import qualified Paths_rattletrap as This

version :: Version.Version
version = This.version
1 change: 1 addition & 0 deletions package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ library:
- regex-compat
- text
- vector
other-modules: Paths_rattletrap
source-dirs: library
license: MIT
license-file: LICENSE.markdown
Expand Down

0 comments on commit 44405f2

Please sign in to comment.