on master help sign in
Added :let and :undefine to the repl help
3762fadAlyssa Carter
src/Idris/Help.hs+11−1
@@ -11,6 +11,10 @@ data CmdArg = ExprArg -- ^ The command takes an expression
11 | NoArg -- ^ No completion (yet!?)
11 | NoArg -- ^ No completion (yet!?)
12 | SpecialHeaderArg -- ^ do not use
12 | SpecialHeaderArg -- ^ do not use
13 | ConsoleWidthArg -- ^ The width of the console
13 | ConsoleWidthArg -- ^ The width of the console
14+ | DeclArg -- ^ An Idris declaration, as might be contained in a file
15+ | ManyArgs CmdArg -- ^ Zero or more of one kind of argument
16+ | OptionalArg CmdArg -- ^ Zero or one of one kind of argument
17+ | SeqArgs CmdArg CmdArg -- ^ One kind of argument followed by another
14
18
15instance Show CmdArg where
19instance Show CmdArg where
16 show ExprArg = "<expr>"
20 show ExprArg = "<expr>"
@@ -24,6 +28,10 @@ instance Show CmdArg where
24 show NoArg = ""
28 show NoArg = ""
25 show SpecialHeaderArg = "Arguments"
29 show SpecialHeaderArg = "Arguments"
26 show ConsoleWidthArg = "auto|infinite|<number>"
30 show ConsoleWidthArg = "auto|infinite|<number>"
31+ show DeclArg = "<top-level declaration>"
32+ show (ManyArgs a) = "(" ++ show a ++ ")..."
33+ show (OptionalArg a) = "[" ++ show a ++ "]"
34+ show (SeqArgs a b) = show a ++ " " ++ show b
27
35
28help :: [([String], CmdArg, String)]
36help :: [([String], CmdArg, String)]
29help =
37help =
@@ -59,7 +67,9 @@ help =
59 ([":colour", ":color"], ColourArg, "Turn REPL colours on or off; set a specific colour"),
67 ([":colour", ":color"], ColourArg, "Turn REPL colours on or off; set a specific colour"),
60 ([":consolewidth"], ConsoleWidthArg, "Set the width of the console"),
68 ([":consolewidth"], ConsoleWidthArg, "Set the width of the console"),
61 ([":q",":quit"], NoArg, "Exit the Idris system"),
69 ([":q",":quit"], NoArg, "Exit the Idris system"),
62− ([":w", ":warranty"], NoArg, "Displays warranty information")
70+ ([":w", ":warranty"], NoArg, "Displays warranty information"),
71+ ([":let"], ManyArgs DeclArg, "Evaluate a declaration, such as a function definition, instance implementation, or fixity declaration"),
72+ ([":undefine",":unlet"], ManyArgs NameArg, "Remove the listed repl definitions, or all repl definitions if no names given")
63 ]
73 ]
64
74
65-- | Use these for completion, but don't show them in :help
75-- | Use these for completion, but don't show them in :help