on cd8a233 help sign in
78 lines 4.9 kB history raw
1module Idris.Help (CmdArg(..), help, extraHelp) 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 | NamespaceArg -- ^ The command takes a namespace name
8 | OptionArg -- ^ The command takes an option
9 | MetaVarArg -- ^ The command takes a metavariable
10 | ColourArg -- ^ The command is the colour-setting command
11 | NoArg -- ^ No completion (yet!?)
12 | SpecialHeaderArg -- ^ do not use
13 | ConsoleWidthArg -- ^ The width of the console
15instance Show CmdArg where
16 show ExprArg = "<expr>"
17 show NameArg = "<name>"
18 show FileArg = "<filename>"
19 show ModuleArg = "<module>"
20 show NamespaceArg = "<namespace>"
21 show OptionArg = "<option>"
22 show MetaVarArg = "<metavar>"
23 show ColourArg = "<option>"
24 show NoArg = ""
25 show SpecialHeaderArg = "Arguments"
26 show ConsoleWidthArg = "auto|infinite|<number>"
28help :: [([String], CmdArg, String)]
29help =
30 [ (["<expr>"], NoArg, "Evaluate an expression"),
31 ([":t"], ExprArg, "Check the type of an expression"),
32 ([":miss", ":missing"], NameArg, "Show missing clauses"),
33 ([":doc"], NameArg, "Show internal documentation"),
34 ([":mkdoc"], NamespaceArg, "Generate IdrisDoc for namespace(s) and dependencies"),
35 ([":apropos"], NoArg, "Search names, types, and documentation"),
36 ([":whocalls", ":wc"], NameArg, "List the callers of some name"),
37 ([":callswho", ":cw"], NameArg, "List the callees of some name"),
38 ([":total"], NameArg, "Check the totality of a name"),
39 ([":r",":reload"], NoArg, "Reload current file"),
40 ([":l",":load"], FileArg, "Load a new file"),
41 ([":cd"], FileArg, "Change working directory"),
42 ([":module"], ModuleArg, "Import an extra module"), -- NOTE: dragons
43 ([":e",":edit"], NoArg, "Edit current file using $EDITOR or $VISUAL"),
44 ([":m",":metavars"], NoArg, "Show remaining proof obligations (metavariables)"),
45 ([":p",":prove"], MetaVarArg, "Prove a metavariable"),
46 ([":a",":addproof"], NameArg, "Add proof to source file"),
47 ([":rmproof"], NameArg, "Remove proof from proof stack"),
48 ([":showproof"], NameArg, "Show proof"),
49 ([":proofs"], NoArg, "Show available proofs"),
50 ([":x"], ExprArg, "Execute IO actions resulting from an expression using the interpreter"),
51 ([":c",":compile"], FileArg, "Compile to an executable [codegen] <filename>"),
52 ([":exec",":execute"], NoArg, "Compile to an executable and run"),
53 ([":dynamic"], FileArg, "Dynamically load a C library (similar to %dynamic)"),
54 ([":dynamic"], NoArg, "List dynamically loaded C libraries"),
55 ([":?",":h",":help"], NoArg, "Display this help text"),
56 ([":set"], OptionArg, "Set an option (errorcontext, showimplicits)"),
57 ([":unset"], OptionArg, "Unset an option"),
58 ([":colour", ":color"], ColourArg, "Turn REPL colours on or off; set a specific colour"),
59 ([":consolewidth"], ConsoleWidthArg, "Set the width of the console"),
60 ([":q",":quit"], NoArg, "Exit the Idris system")
61 ]
63-- | Use these for completion, but don't show them in :help
64extraHelp ::[([String], CmdArg, String)]
65extraHelp =
66 [ ([":casesplit", ":cs"], NoArg, ":cs <line> <name> splits the pattern variable on the line")
67 , ([":casesplit!", ":cs!"], NoArg, ":cs! <line> <name> destructively splits the pattern variable on the line")
68 , ([":addclause", ":ac"], NoArg, ":ac <line> <name> adds a clause for the definition of the name on the line")
69 , ([":addclause!", ":ac!"], NoArg, ":ac! <line> <name> destructively adds a clause for the definition of the name on the line")
70 , ([":addmissing", ":am"], NoArg, ":am <line> <name> adds all missing pattern matches for the name on the line")
71 , ([":addmissing!", ":am!"], NoArg, ":am! <line> <name> destructively adds all missing pattern matches for the name on the line")
72 , ([":makewith", ":mw"], NoArg, ":mw <line> <name> adds a with clause for the definition of the name on the line")
73 , ([":makewith!", ":mw!"], NoArg, ":mw! <line> <name> destructively adds a with clause for the definition of the name on the line")
74 , ([":proofsearch", ":ps"], NoArg, ":ps <line> <name> <names> does proof search for name on line, with names as hints")
75 , ([":proofsearch!", ":ps!"], NoArg, ":ps! <line> <name> <names> destructively does proof search for name on line, with names as hints")
76 , ([":addproofclause", ":apc"], NoArg, ":apc <line> <name> adds a pattern-matching proof clause to name on line")
77 , ([":addproofclause!", ":apc!"], NoArg, ":apc! <line> <name> destructively adds a pattern-matching proof clause to name on line")
78 ]