@@ -21,7 +21,8 @@ data Opts = Opts { really :: Bool,
21 interface :: Bool,
21 interface :: Bool,
22 output :: FilePath }
22 output :: FilePath }
24+showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user.\n"
24−showUsage = do putStrLn "Usage: idris-codegen-c --yes-really <ibc-files> [-o <output-file>]"
25+ putStrLn "Usage: idris-codegen-c --yes-really <ibc-files> [-o <output-file>]"
25 exitWith ExitSuccess
26 exitWith ExitSuccess
27getOpts :: IO Opts
28getOpts :: IO Opts
@@ -49,6 +50,7 @@ main = do opts <- getOpts
49 if (null (inputs opts))
50 if (null (inputs opts))
50 then showUsage
51 then showUsage
51 else if (not $ really opts)
52 else if (not $ really opts)
52− then do putStrLn "This is not what you may expect it is."
53+ then do putStrLn "This code generator is intended to be called by the Idris compiler. \
53− showUsage
54+ \Please pass Idris the '--codegen' flag to choose a backend."
54 else runMain (c_main opts)
56 else runMain (c_main opts)