on 751fb32 help sign in
50 lines 3.0 kB history raw
1module Idris.Help (CmdArg(..), 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 | PkgArgs -- ^ The command takes a list of package names
8 | NumberArg -- ^ The command takes a number
9 | NamespaceArg -- ^ The command takes a namespace name
10 | OptionArg -- ^ The command takes an option
11 | MetaVarArg -- ^ The command takes a metavariable
12 | ColourArg -- ^ The command is the colour-setting command
13 | NoArg -- ^ No completion (yet!?)
14 | SpecialHeaderArg -- ^ do not use
15 | ConsoleWidthArg -- ^ The width of the console
16 | DeclArg -- ^ An Idris declaration, as might be contained in a file
17 | ManyArgs CmdArg -- ^ Zero or more of one kind of argument
18 | OptionalArg CmdArg -- ^ Zero or one of one kind of argument
19 | SeqArgs CmdArg CmdArg -- ^ One kind of argument followed by another
21instance Show CmdArg where
22 show ExprArg = "<expr>"
23 show NameArg = "<name>"
24 show FileArg = "<filename>"
25 show ModuleArg = "<module>"
26 show PkgArgs = "<package list>"
27 show NumberArg = "<number>"
28 show NamespaceArg = "<namespace>"
29 show OptionArg = "<option>"
30 show MetaVarArg = "<hole>"
31 show ColourArg = "<option>"
32 show NoArg = ""
33 show SpecialHeaderArg = "Arguments"
34 show ConsoleWidthArg = "auto|infinite|<number>"
35 show DeclArg = "<top-level declaration>"
36 show (ManyArgs a) = "(" ++ show a ++ ")..."
37 show (OptionalArg a) = "[" ++ show a ++ "]"
38 show (SeqArgs a b) = show a ++ " " ++ show b
40-- | Use these for completion, but don't show them in :help
41extraHelp ::[([String], CmdArg, String)]
42extraHelp =
43 [ ([":casesplit!", ":cs!"], NoArg, ":cs! <line> <name> destructively splits the pattern variable on the line")
44 , ([":addclause!", ":ac!"], NoArg, ":ac! <line> <name> destructively adds a clause for the definition of the name on the line")
45 , ([":addmissing!", ":am!"], NoArg, ":am! <line> <name> destructively adds all missing pattern matches for the name on the line")
46 , ([":makewith!", ":mw!"], NoArg, ":mw! <line> <name> destructively adds a with clause for the definition of the name on the line")
47 , ([":proofsearch!", ":ps!"], NoArg, ":ps! <line> <name> <names> destructively does proof search for name on line, with names as hints")
48 , ([":addproofclause!", ":apc!"], NoArg, ":apc! <line> <name> destructively adds a pattern-matching proof clause to name on line")
49 , ([":refine!", ":ref!"], NoArg, ":ref! <line> <name> <name'> destructively attempts to partially solve name on line, with name' as hint, introducing holes for arguments that aren't inferrable")
50 ]