forked from purescript/purescript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMessage.hs
More file actions
59 lines (49 loc) · 1.66 KB
/
Message.hs
File metadata and controls
59 lines (49 loc) · 1.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
module Language.PureScript.Interactive.Message where
import Prelude
import Data.List (intercalate)
import Data.Version (showVersion)
import qualified Paths_purescript as Paths
import qualified Language.PureScript.Interactive.Directive as D
import Language.PureScript.Interactive.Types
-- Messages
-- | The guide URL
guideURL :: String
guideURL = "https://github.com/purescript/documentation/blob/master/guides/PSCi.md"
-- | The help message.
helpMessage :: String
helpMessage = "The following commands are available:\n\n " ++
intercalate "\n " (map line D.help) ++
"\n\n" ++ extraHelp
where
line :: (Directive, String, String) -> String
line (dir, arg, desc) =
let cmd = ':' : D.stringFor dir
in unwords [ cmd
, replicate (11 - length cmd) ' '
, arg
, replicate (11 - length arg) ' '
, desc
]
extraHelp =
"Further information is available on the PureScript documentation repository:\n" ++
" --> " ++ guideURL
-- | The welcome prologue.
prologueMessage :: String
prologueMessage = unlines
[ "PSCi, version " ++ showVersion Paths.version
, "Type :? for help"
]
noInputMessage :: String
noInputMessage = unlines
[ "purs repl: No input files; try running `pulp psci` instead."
, "For help getting started, visit " ++ guideURL
, "Usage: For basic information, try the `--help' option."
]
supportModuleMessage :: String
supportModuleMessage = unlines
[ "purs repl: PSCi requires the psci-support package."
, "For help getting started, visit " ++ guideURL
]
-- | The quit message.
quitMessage :: String
quitMessage = "See ya!"