diff --git a/hsb2hs.cabal b/hsb2hs.cabal
--- a/hsb2hs.cabal
+++ b/hsb2hs.cabal
@@ -1,5 +1,5 @@
 Name:         hsb2hs
-Version:      0.3
+Version:      0.3.1
 Synopsis:     Preprocesses a file, adding blobs from files as string literals.
 Description:
     hsb2hs is a preprocessor that allows you to include the contents of
diff --git a/hsb2hs.hs b/hsb2hs.hs
--- a/hsb2hs.hs
+++ b/hsb2hs.hs
@@ -9,11 +9,15 @@
 import Control.Applicative ((<$>))
 import Control.Monad
 import System.FilePath
+import Data.Version (showVersion)
+import Paths_hsb2hs (version)
 
 main :: IO ()
 main = do
   args <- getArgs
-  transform blobExtension args
+  if "--version" `elem` args
+     then putStrLn (showVersion version)
+     else transform blobExtension args
 
 blobExtension :: Extension
 blobExtension = base{
