on master help sign in
Merge pull request #4211 from msmorgan/repl-version
f8509e4Jan de Muijnck-Hughes
src/Idris/REPL.hs+2
@@ -601,6 +601,7 @@ splitName s = case reverse $ splitOn "." s of
601 unparen str = str
601 unparen str = str
602
602
603idemodeProcess :: FilePath -> Command -> Idris ()
603idemodeProcess :: FilePath -> Command -> Idris ()
604+idemodeProcess fn ShowVersion = process fn ShowVersion
604idemodeProcess fn Warranty = process fn Warranty
605idemodeProcess fn Warranty = process fn Warranty
605idemodeProcess fn Help = process fn Help
606idemodeProcess fn Help = process fn Help
606idemodeProcess fn (RunShellCommand cmd) =
607idemodeProcess fn (RunShellCommand cmd) =
@@ -828,6 +829,7 @@ insertScript prf (x : xs) = x : insertScript prf xs
828
829
829process :: FilePath -> Command -> Idris ()
830process :: FilePath -> Command -> Idris ()
830process fn Help = iPrintResult displayHelp
831process fn Help = iPrintResult displayHelp
832+process fn ShowVersion = iPrintResult getIdrisVersion
831process fn Warranty = iPrintResult warranty
833process fn Warranty = iPrintResult warranty
832process fn (RunShellCommand cmd) = runIO $ system cmd >> return ()
834process fn (RunShellCommand cmd) = runIO $ system cmd >> return ()
833process fn (ChangeDirectory f)
835process fn (ChangeDirectory f)
src/Idris/REPL/Commands.hs+1
@@ -71,6 +71,7 @@ data Command = Quit
71 | CallsWho Name
71 | CallsWho Name
72 | Browse [String]
72 | Browse [String]
73 | MakeDoc String -- IdrisDoc
73 | MakeDoc String -- IdrisDoc
74+ | ShowVersion
74 | Warranty
75 | Warranty
75 | PrintDef Name
76 | PrintDef Name
76 | PPrint OutputFmt Int PTerm
77 | PPrint OutputFmt Int PTerm
src/Idris/REPL/Parser.hs+1
@@ -111,6 +111,7 @@ parserCommandsForHelp =
111 , (["consolewidth"], ConsoleWidthArg, "Set the width of the console", cmd_consolewidth)
111 , (["consolewidth"], ConsoleWidthArg, "Set the width of the console", cmd_consolewidth)
112 , (["printerdepth"], OptionalArg NumberArg, "Set the maximum pretty-printer depth (no arg for infinite)", cmd_printdepth)
112 , (["printerdepth"], OptionalArg NumberArg, "Set the maximum pretty-printer depth (no arg for infinite)", cmd_printdepth)
113 , noArgCmd ["q", "quit"] Quit "Exit the Idris system"
113 , noArgCmd ["q", "quit"] Quit "Exit the Idris system"
114+ , noArgCmd ["version"] ShowVersion "Display the Idris version"
114 , noArgCmd ["warranty"] Warranty "Displays warranty information"
115 , noArgCmd ["warranty"] Warranty "Displays warranty information"
115 , (["let"], ManyArgs DeclArg
116 , (["let"], ManyArgs DeclArg
116 , "Evaluate a declaration, such as a function definition, instance implementation, or fixity declaration"
117 , "Evaluate a declaration, such as a function definition, instance implementation, or fixity declaration"