on master help sign in
Merge pull request #1176 from david-christiansen/init-banner
de6bee5David 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"
@@ -1352,6 +1354,7 @@ idrisMain opts =
1352 setVerbose verbose
1354 setVerbose verbose
1353 setCmdLine opts
1355 setCmdLine opts
1354 setOutputTy outty
1356 setOutputTy outty
1357+ setNoBanner nobanner
1355 setCodegen cgn
1358 setCodegen cgn
1356 setTargetTriple trpl
1359 setTargetTriple trpl
1357 setTargetCPU tcpu
1360 setTargetCPU tcpu
@@ -1366,6 +1369,8 @@ idrisMain opts =
1366 (d:_) -> setIBCSubDir d
1369 (d:_) -> setIBCSubDir d
1367 setImportDirs importdirs
1370 setImportDirs importdirs
1368
1371
1372+ setNoBanner nobanner
1373+
1369 when (not (NoBasePkgs `elem` opts)) $ do
1374 when (not (NoBasePkgs `elem` opts)) $ do
1370 addPkgDir "prelude"
1375 addPkgDir "prelude"
1371 addPkgDir "base"
1376 addPkgDir "base"
@@ -1375,6 +1380,11 @@ idrisMain opts =
1375 return ()
1380 return ()
1376 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
1381 when (not (NoPrelude `elem` opts)) $ do x <- loadModule stdout "Prelude"
1377 return ()
1382 return ()
1383+
1384+ when (runrepl && not idesl) initScript
1385+
1386+ nobanner <- getNoBanner
1387+
1378 when (runrepl &&
1388 when (runrepl &&
1379 not quiet &&
1389 not quiet &&
1380 not idesl &&
1390 not idesl &&
@@ -1425,7 +1435,6 @@ idrisMain opts =
1425
1435
1426 when (runrepl && not idesl) $ do
1436 when (runrepl && not idesl) $ do
1427-- clearOrigPats
1437-- clearOrigPats
1428− initScript
1429 startServer orig inputs
1438 startServer orig inputs
1430 runInputT (replSettings (Just historyFile)) $ repl orig inputs
1439 runInputT (replSettings (Just historyFile)) $ repl orig inputs
1431 when (idesl) $ ideslaveStart orig inputs
1440 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