From 855488fd925ed47bc1d282993b4009b94515192a Mon Sep 17 00:00:00 2001 From: Niklas Larsson Date: Thu, 17 Sep 2015 21:50:55 +0200 Subject: [PATCH] The "--yes-really" argument has been removed from idris. Updated the usage with a hint for humans. --- src/Main.hs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/Main.hs b/src/Main.hs index 6bc9b5c..d4dbbb8 100644 --- a/src/Main.hs +++ b/src/Main.hs @@ -11,18 +11,18 @@ import IRTS.CodegenJava import System.Environment import System.Exit -data Opts = Opts { really :: Bool, - inputs :: [FilePath], +data Opts = Opts { inputs :: [FilePath], output :: FilePath } -showUsage = do putStrLn "Usage: idris-java [-o ]" +showUsage = do putStrLn "Usage: idris-codegen-java [-o ]" + putStrLn "Note for humans: You likely want to use this via the idris executable" + putStrLn "by adding '--codegen java' to the idris command." exitWith ExitSuccess getOpts :: IO Opts getOpts = do xs <- getArgs - return $ process (Opts False [] "a.out") xs + return $ process (Opts [] "a.out") xs where - process opts ("--yes-really":xs) = process (opts { really = True }) xs process opts ("-o":o:xs) = process (opts { output = o }) xs process opts (x:xs) = process (opts { inputs = x:inputs opts }) xs process opts [] = opts @@ -38,11 +38,7 @@ main :: IO () main = do opts <- getOpts if (null (inputs opts)) then showUsage - else if (not $ really opts) - then do putStrLn "This code generator is intended to be called by the Idris compiler. \ - \Please pass Idris the '--codegen' flag to choose a backend." - exitWith ExitSuccess - else runMain (java_main opts) + else runMain (java_main opts)