@@ -182,12 +182,10 @@ process fn (Defn n) = do i <- get
182 where printCase i (lhs, rhs) = do liftIO $ putStr $ showImp True (delab i lhs)
182 where printCase i (lhs, rhs) = do liftIO $ putStr $ showImp True (delab i lhs)
183 liftIO $ putStr " = "
183 liftIO $ putStr " = "
184 liftIO $ putStrLn $ showImp True (delab i rhs)
184 liftIO $ putStrLn $ showImp True (delab i rhs)
185− showTotal t@(Partial (Other ns)) i
185+process fn (TotCheck n) = do i <- get
186− = show t ++ "\n\t" ++ showSep "\n\t" (map (showTotalN i) ns)
187− showTotal t i = show t
188− showTotalN i n = case lookupTotal n (tt_ctxt i) of
186+ case lookupTotal n (tt_ctxt i) of
189− [t] -> showTotal t i
187+ [t] -> iputStrLn (showTotal t i)
190− _ -> ""
188+ _ -> return ()
191process fn (Info n) = do i <- get
189process fn (Info n) = do i <- get
192 let oi = lookupCtxt Nothing n (idris_optimisation i)
190 let oi = lookupCtxt Nothing n (idris_optimisation i)
193 liftIO $ print oi
191 liftIO $ print oi
@@ -232,6 +230,13 @@ process fn Metavars
232 _ -> iputStrLn $ "Global metavariables:\n\t" ++ show mvs
230 _ -> iputStrLn $ "Global metavariables:\n\t" ++ show mvs
233process fn NOP = return ()
231process fn NOP = return ()
233+showTotal t@(Partial (Other ns)) i
234+ = show t ++ "\n\t" ++ showSep "\n\t" (map (showTotalN i) ns)
235+showTotal t i = show t
236+showTotalN i n = case lookupTotal n (tt_ctxt i) of
237+ [t] -> showTotal t i
235displayHelp = let vstr = showVersion version in
240displayHelp = let vstr = showVersion version in
236 "\nIdris version " ++ vstr ++ "\n" ++
241 "\nIdris version " ++ vstr ++ "\n" ++
237 "--------------" ++ map (\x -> '-') vstr ++ "\n\n" ++
242 "--------------" ++ map (\x -> '-') vstr ++ "\n\n" ++
@@ -246,6 +251,7 @@ help =
246 ([""], "", ""),
251 ([""], "", ""),
247 (["<expr>"], "", "Evaluate an expression"),
252 (["<expr>"], "", "Evaluate an expression"),
248 ([":t"], "<expr>", "Check the type of an expression"),
253 ([":t"], "<expr>", "Check the type of an expression"),
254+ ([":total"], "<name>", "Check the totality of a name"),
249 ([":r",":reload"], "", "Reload current file"),
255 ([":r",":reload"], "", "Reload current file"),
250 ([":e",":edit"], "", "Edit current file using $EDITOR or $VISUAL"),
256 ([":e",":edit"], "", "Edit current file using $EDITOR or $VISUAL"),
251 ([":m",":metavars"], "", "Show remaining proof obligations (metavariables)"),
257 ([":m",":metavars"], "", "Show remaining proof obligations (metavariables)"),