on master help sign in
Allow the big startup banner to be disabled

This is done by adding `:set nobanner` to the init script. Fixes #590.

commit47304d9c9595f1793bed5321fb6bea6c0f055321 authorDavid Raymond Christiansen <david@davidchristiansen.dk> dateFri 2 May 2014, 15:09 (12 years ago) parenta92dfa1
4 files changed+13−1
CHANGELOG+1 src/Idris/Completion.hs+1 src/Idris/REPL.hs+10−1 src/Idris/REPLParser.hs+1
CHANGELOG+1
@@ -12,6 +12,7 @@ New in 0.9.13:
1212* New (first class) nested record update/access syntax:
1313 record { a->b->c = val } x -- sets field accessed by c (b (a x)) to val
1414 record { a->b->c } x -- accesses field, equivalent to c (b (a x))
15+* The banner at startup can be suppressed by adding :set nobanner to the initialisation script.
1516
1617Internal changes
1718
src/Idris/Completion.hs+1
@@ -112,6 +112,7 @@ completeOption = completeWord Nothing " \t" completeOpt
112112 , "showimplicits"
113113 , "originalerrors"
114114 , "autosolve"
115+ , "nobanner"
115116 ]
116117
117118completeConsoleWidth :: CompletionFunc Idris
src/Idris/REPL.hs+10−1
@@ -1031,6 +1031,8 @@ process h fn (SetOpt ShowOrigErr) = setShowOrigErr True
10311031process h fn (UnsetOpt ShowOrigErr) = setShowOrigErr False
10321032process h fn (SetOpt AutoSolve) = setAutoSolve True
10331033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1034+process h fn (SetOpt NoBanner) = setNoBanner True
1035+process h fn (UnsetOpt NoBanner) = setNoBanner False
10341036
10351037process h fn (SetOpt _) = iPrintError "Not a valid option"
10361038process h fn (UnsetOpt _) = iPrintError "Not a valid option"
@@ -1353,6 +1355,7 @@ idrisMain opts =
13531355 setVerbose verbose
13541356 setCmdLine opts
13551357 setOutputTy outty
1358+ setNoBanner nobanner
13561359 setCodegen cgn
13571360 setTargetTriple trpl
13581361 setTargetCPU tcpu
@@ -1367,6 +1370,8 @@ idrisMain opts =
13671370 (d:_) -> setIBCSubDir d
13681371 setImportDirs importdirs
13691372
1373+ setNoBanner nobanner
1374+
13701375 when (not (NoBasePkgs `elem` opts)) $ do
13711376 addPkgDir "prelude"
13721377 addPkgDir "base"
@@ -1376,6 +1381,11 @@ idrisMain opts =
13761381 return ()
13771382 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
13781383 return ()
1384+
1385+ when (runrepl && not idesl) initScript
1386+
1387+ nobanner <- getNoBanner
1388+
13791389 when (runrepl &&
13801390 not quiet &&
13811391 not idesl &&
@@ -1426,7 +1436,6 @@ idrisMain opts =
14261436
14271437 when (runrepl && not idesl) $ do
14281438-- clearOrigPats
1429− initScript
14301439 startServer orig inputs
14311440 runInputT (replSettings (Just historyFile)) $ repl orig inputs
14321441 when (idesl) $ ideslaveStart orig inputs
src/Idris/REPLParser.hs+1
@@ -119,6 +119,7 @@ pOption = do discard (P.symbol "errorcontext"); return ErrContext
119119 <|> do discard (P.symbol "showimplicits"); return ShowImpl
120120 <|> do discard (P.symbol "originalerrors"); return ShowOrigErr
121121 <|> do discard (P.symbol "autosolve"); return AutoSolve
122+ <|> do discard (P.symbol "nobanner") ; return NoBanner
122123
123124codegenOption :: P.IdrisParser Codegen
124125codegenOption = do discard (P.symbol "javascript"); return ViaJavaScript