File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,8 @@ import Control.Monad.Trans.Except
3131import Control.Monad.Error.Class (MonadError (.. ))
3232import Control.Monad.Writer
3333
34+ import Options.Applicative hiding (str )
35+
3436import System.Directory (doesFileExist )
3537import System.Process (readProcess )
3638import System.Exit (exitFailure )
@@ -42,11 +44,24 @@ import qualified Web.Bower.PackageMeta as Bower
4244
4345import qualified Language.PureScript as P (version )
4446import qualified Language.PureScript.Docs as D
47+ import qualified Paths_purescript as Paths
48+
4549import Utils
4650import ErrorsWarnings
4751
4852main :: IO ()
49- main = do
53+ main = execParser opts >> publish
54+ where
55+ opts = info (version <*> helper) infoModList
56+ infoModList = fullDesc <> headerInfo <> footerInfo
57+ headerInfo = header " psc-publish - Generates documentation packages for upload to http://pursuit.purescript.org"
58+ footerInfo = footer $ " psc-publish " ++ showVersion Paths. version
59+
60+ version :: Parser (a -> a )
61+ version = abortOption (InfoMsg (showVersion Paths. version)) $ long " version" <> help " Show the version number" <> hidden
62+
63+ publish :: IO ()
64+ publish = do
5065 pkg <- preparePackage
5166 BL. putStrLn (A. encode pkg)
5267
You can’t perform that action at this time.
0 commit comments