git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Add makefile gen, help command to pscpp
commit0eacad3f24089e0cea21301a06d3146d5d87d85e authorAndy Arvanitis <andyarvanitis@gmail.com> dateSat 25 Aug 2018, 17:55 (8 years ago) parent7a1df6f
1 file changed+19
app/Main.hs+19
app/Main.hs+19
@@ -60,6 +60,10 @@ main = do
6060 if "--tests" `elem` opts'
6161 then runTests
6262 else do
63+ when ("--makefile" `elem` opts') $
64+ T.writeFile "Makefile" $ T.decodeUtf8 $(embedFile "support/Makefile")
65+ when ("--help" `elem` opts') $
66+ putStrLn help
6367 mapM (generateCode opts') files
6468 return ()
6569
@@ -128,3 +132,18 @@ toUCNs = T.pack . concatMap toUCN . T.unpack
128132toUCN :: Char -> String
129133toUCN c | isAscii c = [c]
130134toUCN c = printf "\\U%08x" $ ord c
135+
136+help :: String
137+help = "Usage: pscpp OPTIONS COREFN-FILES\n\
138+ \ PureScript-to-C++ compiler\n\n\
139+ \Available options:\n\
140+ \ --help Show this help text\n\n\
141+ \ --makefile Generate a GNU Makefile which can be used for compiling\n\
142+ \ a PureScript program and libraries to a native binary via\n\
143+ \ purs corefn output and C++\n\n\
144+ \ --ucns Use UCN encoding of unicode characters in literals and\n\
145+ \ strings in generated C++ code (for compilers that do not\n\
146+ \ support unicode literals, such as gcc)\n\n\
147+ \ --tests Run test cases (under construction)\n\n\
148+ \See also:\n\
149+ \ purs compile --help\n"