on de0bcbd help sign in
53 lines 2.8 kB history raw
1module Idris.Help (CmdArg(..), help) where
3data CmdArg = ExprArg -- ^ The command takes an expression
4 | NameArg -- ^ The command takes a name
5 | FileArg -- ^ The command takes a file
6 | ModuleArg -- ^ The command takes a module name
7 | OptionArg -- ^ The command takes an option
8 | MetaVarArg -- ^ The command takes a metavariable
9 | ColourArg -- ^ The command is the colour-setting command
10 | NoArg -- ^ No completion (yet!?)
11 | SpecialHeaderArg -- ^ do not use
13instance Show CmdArg where
14 show ExprArg = "<expr>"
15 show NameArg = "<name>"
16 show FileArg = "<filename>"
17 show ModuleArg = "<module>"
18 show OptionArg = "<option>"
19 show MetaVarArg = "<metavar>"
20 show ColourArg = "<option>"
21 show NoArg = ""
22 show SpecialHeaderArg = "Arguments"
24help :: [([String], CmdArg, String)]
25help =
26 [ (["<expr>"], NoArg, "Evaluate an expression"),
27 ([":t"], ExprArg, "Check the type of an expression"),
28 ([":miss", ":missing"], NameArg, "Show missing clauses"),
29 ([":i", ":info"], NameArg, "Display information about a type class"),
30 ([":total"], NameArg, "Check the totality of a name"),
31 ([":r",":reload"], NoArg, "Reload current file"),
32 ([":l",":load"], FileArg, "Load a new file"),
33 ([":cd"], FileArg, "Change working directory"),
34 ([":m",":module"], ModuleArg, "Import an extra module"), -- NOTE: dragons
35 ([":e",":edit"], NoArg, "Edit current file using $EDITOR or $VISUAL"),
36 ([":m",":metavars"], MetaVarArg, "Show remaining proof obligations (metavariables)"),
37 ([":p",":prove"], MetaVarArg, "Prove a metavariable"),
38 ([":a",":addproof"], NameArg, "Add proof to source file"),
39 ([":rmproof"], NameArg, "Remove proof from proof stack"),
40 ([":showproof"], NameArg, "Show proof"),
41 ([":proofs"], NoArg, "Show available proofs"),
42 ([":x"], ExprArg, "Execute IO actions resulting from an expression using the interpreter"),
43 ([":c",":compile"], FileArg, "Compile to an executable <filename>"),
44 ([":js", ":javascript"], FileArg, "Compile to JavaScript <filename>"),
45 ([":exec",":execute"], NoArg, "Compile to an executable and run"),
46 ([":dynamic"], FileArg, "Dynamically load a C library (similar to %dynamic)"),
47 ([":dynamic"], NoArg, "List dynamically loaded C libraries"),
48 ([":?",":h",":help"], NoArg, "Display this help text"),
49 ([":set"], OptionArg, "Set an option (errorcontext, showimplicits)"),
50 ([":unset"], OptionArg, "Unset an option"),
51 ([":colour", ":color"], ColourArg, "Turn REPL colours on or off; set a specific colour"),
52 ([":q",":quit"], NoArg, "Exit the Idris system")
53 ]