on master help sign in
Remove --yes-really

See discussion on #2579

commitb19d03cfb93adc6dc5b2fd72c4fb32b7ef21c21d authorNiklas Larsson <niklas@mm.st> dateFri 11 Sep 2015, 17:59 (11 years ago) parentcb11c39
4 files changed+14−34
codegen/idris-codegen-c/Main.hs+4−11 codegen/idris-codegen-javascript/Main.hs+5−11 codegen/idris-codegen-node/Main.hs+4−11 src/IRTS/Compiler.hs+1−1
codegen/idris-codegen-c/Main.hs+4−11
@@ -16,21 +16,18 @@ import Paths_idris
1616
1717import Util.System
1818
19−data Opts = Opts { really :: Bool,
20− inputs :: [FilePath],
19+data Opts = Opts { inputs :: [FilePath],
2120 interface :: Bool,
2221 output :: FilePath }
2322
2423showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
25− putStrLn "To call the code generator manually, pass the --yes-really option.\n"
26− putStrLn "Usage: idris-codegen-c [--yes-really] <ibc-files> [-o <output-file>]"
24+ putStrLn "Usage: idris-codegen-c <ibc-files> [-o <output-file>]"
2725 exitWith ExitSuccess
2826
2927getOpts :: IO Opts
3028getOpts = do xs <- getArgs
31− return $ process (Opts False [] False "a.out") xs
29+ return $ process (Opts [] False "a.out") xs
3230 where
33− process opts ("--yes-really":xs) = process (opts { really = True }) xs
3431 process opts ("-o":o:xs) = process (opts { output = o }) xs
3532 process opts ("--interface":xs) = process (opts { interface = True }) xs
3633 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
@@ -50,8 +47,4 @@ main :: IO ()
5047main = do opts <- getOpts
5148 if (null (inputs opts))
5249 then showUsage
53− else if (not $ really opts)
54− then do putStrLn "This code generator is intended to be called by the Idris compiler. \
55− \Please pass Idris the '--codegen' flag to choose a backend."
56− exitWith ExitSuccess
57− else runMain (c_main opts)
50+ else runMain (c_main opts)
codegen/idris-codegen-javascript/Main.hs+5−11
@@ -13,21 +13,19 @@ import System.Exit
1313
1414import Paths_idris
1515
16−data Opts = Opts { really :: Bool
17− , inputs :: [FilePath]
16+data Opts = Opts {
17+ inputs :: [FilePath]
1818 , output :: FilePath
1919 }
2020
2121showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
22− putStrLn "To call the code generator manually, pass the --yes-really option.\n"
23− putStrLn "Usage: idris-codegen-c [--yes-really] <ibc-files> [-o <output-file>]"
22+ putStrLn "Usage: idris-codegen-javascript <ibc-files> [-o <output-file>]"
2423 exitWith ExitSuccess
2524
2625getOpts :: IO Opts
2726getOpts = do xs <- getArgs
28− return $ process (Opts False [] "main.js") xs
27+ return $ process (Opts [] "main.js") xs
2928 where
30− process opts ("--yes-really":xs) = process (opts { really = True }) xs
3129 process opts ("-o":o:xs) = process (opts { output = o }) xs
3230 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
3331 process opts [] = opts
@@ -43,8 +41,4 @@ main :: IO ()
4341main = do opts <- getOpts
4442 if (null (inputs opts))
4543 then showUsage
46− else if (not $ really opts)
47− then do putStrLn "This code generator is intended to be called by the Idris compiler. \
48− \Please pass Idris the '--codegen' flag to choose a backend."
49− exitWith ExitSuccess
50− else runMain (jsMain opts)
44+ else runMain (jsMain opts)
codegen/idris-codegen-node/Main.hs+4−11
@@ -13,21 +13,18 @@ import System.Exit
1313
1414import Paths_idris
1515
16−data Opts = Opts { really :: Bool
17− , inputs :: [FilePath]
16+data Opts = Opts { inputs :: [FilePath]
1817 , output :: FilePath
1918 }
2019
2120showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user."
22− putStrLn "To call the code generator manually, pass the --yes-really option.\n"
23− putStrLn "Usage: idris-codegen-c [--yes-really] <ibc-files> [-o <output-file>]"
21+ putStrLn "Usage: idris-codegen-node <ibc-files> [-o <output-file>]"
2422 exitWith ExitSuccess
2523
2624getOpts :: IO Opts
2725getOpts = do xs <- getArgs
28− return $ process (Opts False [] "main.js") xs
26+ return $ process (Opts [] "main.js") xs
2927 where
30− process opts ("--yes-really":xs) = process (opts { really = True }) xs
3128 process opts ("-o":o:xs) = process (opts { output = o }) xs
3229 process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs
3330 process opts [] = opts
@@ -43,8 +40,4 @@ main :: IO ()
4340main = do opts <- getOpts
4441 if (null (inputs opts))
4542 then showUsage
46− else if (not $ really opts)
47− then do putStrLn "This code generator is intended to be called by the Idris compiler. \
48− \Please pass Idris the '--codegen' flag to choose a backend."
49− exitWith ExitSuccess
50− else runMain (jsMain opts)
43+ else runMain (jsMain opts)
src/IRTS/Compiler.hs+1−1
@@ -125,7 +125,7 @@ generate codegen mainmod ir
125125 Via "c" -> codegenC ir
126126 -- Any external code generator
127127 Via cg -> do let cmd = "idris-codegen-" ++ cg
128− args = ["--yes-really", mainmod, "-o", outputFile ir] ++ compilerFlags ir
128+ args = [mainmod, "-o", outputFile ir] ++ compilerFlags ir
129129 exit <- rawSystem cmd args
130130 when (exit /= ExitSuccess) $
131131 putStrLn ("FAILURE: " ++ show cmd ++ " " ++ show args)