on master help sign in
improve help messages
524c223Сухарик
codegen/idris-codegen-c/Main.hs+5−3
@@ -21,7 +21,8 @@ data Opts = Opts { really :: Bool,
21 interface :: Bool,
21 interface :: Bool,
22 output :: FilePath }
22 output :: FilePath }
23
23
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
26
27
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."
55+ exitWith ExitSuccess
54 else runMain (c_main opts)
56 else runMain (c_main opts)
codegen/idris-codegen-javascript/Main.hs+5−3
@@ -18,7 +18,8 @@ data Opts = Opts { really :: Bool
18 , output :: FilePath
18 , output :: FilePath
19 }
19 }
20
20
21+showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user.\n"
21−showUsage = do putStrLn "Usage: idris-codegen-javascript --yes-really <ibc-files> [-o <output-file>]"
22+ putStrLn "Usage: idris-codegen-javascript --yes-really <ibc-files> [-o <output-file>]"
22 exitWith ExitSuccess
23 exitWith ExitSuccess
23
24
24getOpts :: IO Opts
25getOpts :: IO Opts
@@ -42,6 +43,7 @@ main = do opts <- getOpts
42 if (null (inputs opts))
43 if (null (inputs opts))
43 then showUsage
44 then showUsage
44 else if (not $ really opts)
45 else if (not $ really opts)
45− then do putStrLn "This is not what you may expect it is."
46+ then do putStrLn "This code generator is intended to be called by the Idris compiler. \
46− showUsage
47+ \Please pass Idris the '--codegen' flag to choose a backend."
48+ exitWith ExitSuccess
47 else runMain (jsMain opts)
49 else runMain (jsMain opts)
codegen/idris-codegen-node/Main.hs+5−3
@@ -18,7 +18,8 @@ data Opts = Opts { really :: Bool
18 , output :: FilePath
18 , output :: FilePath
19 }
19 }
20
20
21+showUsage = do putStrLn "A code generator which is intended to be called by the compiler, not by a user.\n"
21−showUsage = do putStrLn "Usage: idris-codegen-node --yes-really <ibc-files> [-o <output-file>]"
22+ putStrLn "Usage: idris-codegen-node --yes-really <ibc-files> [-o <output-file>]"
22 exitWith ExitSuccess
23 exitWith ExitSuccess
23
24
24getOpts :: IO Opts
25getOpts :: IO Opts
@@ -42,6 +43,7 @@ main = do opts <- getOpts
42 if (null (inputs opts))
43 if (null (inputs opts))
43 then showUsage
44 then showUsage
44 else if (not $ really opts)
45 else if (not $ really opts)
45− then do putStrLn "This is not what you may expect it is."
46+ then do putStrLn "This code generator is intended to be called by the Idris compiler. \
46− showUsage
47+ \Please pass Idris the '--codegen' flag to choose a backend."
48+ exitWith ExitSuccess
47 else runMain (jsMain opts)
49 else runMain (jsMain opts)