on master help sign in
Allow the big startup banner to be disabled
47304d9David Raymond Christiansen
CHANGELOG+1
@@ -12,6 +12,7 @@ New in 0.9.13:
12* New (first class) nested record update/access syntax:
12* New (first class) nested record update/access syntax:
13 record { a->b->c = val } x -- sets field accessed by c (b (a x)) to val
13 record { a->b->c = val } x -- sets field accessed by c (b (a x)) to val
14 record { a->b->c } x -- accesses field, equivalent to c (b (a x))
14 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.
15
16
16Internal changes
17Internal changes
17
18
src/Idris/Completion.hs+1
@@ -112,6 +112,7 @@ completeOption = completeWord Nothing " \t" completeOpt
112 , "showimplicits"
112 , "showimplicits"
113 , "originalerrors"
113 , "originalerrors"
114 , "autosolve"
114 , "autosolve"
115+ , "nobanner"
115 ]
116 ]
116
117
117completeConsoleWidth :: CompletionFunc Idris
118completeConsoleWidth :: CompletionFunc Idris
src/Idris/REPL.hs+10−1
@@ -1031,6 +1031,8 @@ process h fn (SetOpt ShowOrigErr) = setShowOrigErr True
1031process h fn (UnsetOpt ShowOrigErr) = setShowOrigErr False
1031process h fn (UnsetOpt ShowOrigErr) = setShowOrigErr False
1032process h fn (SetOpt AutoSolve) = setAutoSolve True
1032process h fn (SetOpt AutoSolve) = setAutoSolve True
1033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1033process h fn (UnsetOpt AutoSolve) = setAutoSolve False
1034+process h fn (SetOpt NoBanner) = setNoBanner True
1035+process h fn (UnsetOpt NoBanner) = setNoBanner False
1034
1036
1035process h fn (SetOpt _) = iPrintError "Not a valid option"
1037process h fn (SetOpt _) = iPrintError "Not a valid option"
1036process h fn (UnsetOpt _) = iPrintError "Not a valid option"
1038process h fn (UnsetOpt _) = iPrintError "Not a valid option"
@@ -1353,6 +1355,7 @@ idrisMain opts =
1353 setVerbose verbose
1355 setVerbose verbose
1354 setCmdLine opts
1356 setCmdLine opts
1355 setOutputTy outty
1357 setOutputTy outty
1358+ setNoBanner nobanner
1356 setCodegen cgn
1359 setCodegen cgn
1357 setTargetTriple trpl
1360 setTargetTriple trpl
1358 setTargetCPU tcpu
1361 setTargetCPU tcpu
@@ -1367,6 +1370,8 @@ idrisMain opts =
1367 (d:_) -> setIBCSubDir d
1370 (d:_) -> setIBCSubDir d
1368 setImportDirs importdirs
1371 setImportDirs importdirs
1369
1372
1373+ setNoBanner nobanner
1374+
1370 when (not (NoBasePkgs `elem` opts)) $ do
1375 when (not (NoBasePkgs `elem` opts)) $ do
1371 addPkgDir "prelude"
1376 addPkgDir "prelude"
1372 addPkgDir "base"
1377 addPkgDir "base"
@@ -1376,6 +1381,11 @@ idrisMain opts =
1376 return ()
1381 return ()
1377 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
1382 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
1378 return ()
1383 return ()
1384+
1385+ when (runrepl && not idesl) initScript
1386+
1387+ nobanner <- getNoBanner
1388+
1379 when (runrepl &&
1389 when (runrepl &&
1380 not quiet &&
1390 not quiet &&
1381 not idesl &&
1391 not idesl &&
@@ -1426,7 +1436,6 @@ idrisMain opts =
1426
1436
1427 when (runrepl && not idesl) $ do
1437 when (runrepl && not idesl) $ do
1428-- clearOrigPats
1438-- clearOrigPats
1429− initScript
1430 startServer orig inputs
1439 startServer orig inputs
1431 runInputT (replSettings (Just historyFile)) $ repl orig inputs
1440 runInputT (replSettings (Just historyFile)) $ repl orig inputs
1432 when (idesl) $ ideslaveStart orig inputs
1441 when (idesl) $ ideslaveStart orig inputs
src/Idris/REPLParser.hs+1
@@ -119,6 +119,7 @@ pOption = do discard (P.symbol "errorcontext"); return ErrContext
119 <|> do discard (P.symbol "showimplicits"); return ShowImpl
119 <|> do discard (P.symbol "showimplicits"); return ShowImpl
120 <|> do discard (P.symbol "originalerrors"); return ShowOrigErr
120 <|> do discard (P.symbol "originalerrors"); return ShowOrigErr
121 <|> do discard (P.symbol "autosolve"); return AutoSolve
121 <|> do discard (P.symbol "autosolve"); return AutoSolve
122+ <|> do discard (P.symbol "nobanner") ; return NoBanner
122
123
123codegenOption :: P.IdrisParser Codegen
124codegenOption :: P.IdrisParser Codegen
124codegenOption = do discard (P.symbol "javascript"); return ViaJavaScript
125codegenOption = do discard (P.symbol "javascript"); return ViaJavaScript