-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbyline.cabal
188 lines (168 loc) · 5.61 KB
/
byline.cabal
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
cabal-version: 2.2
name: byline
version: 1.1.2
homepage: https://github.com/pjones/byline
bug-reports: https://github.com/pjones/byline/issues
license: BSD-2-Clause
license-file: LICENSE
author: Peter Jones <[email protected]>
maintainer: Peter Jones <[email protected]>
copyright: Copyright: (c) 2015-2023 Peter J. Jones
category: System, User Interfaces
build-type: Simple
stability: stable
tested-with: GHC ==8.10.7 || ==9.0.2 || ==9.2.5 || ==9.4.8
synopsis:
Library for creating command-line interfaces (colors, menus, etc.)
description:
Byline simplifies writing interactive command-line applications by
building upon @ansi-terminal@ and @haskeline@. This makes it
possible to print messages and prompts that include terminal escape
sequences (such as setting text colors) that are automatically
disabled when standard input is a file. It also means that Byline
works on both POSIX-compatible systems and on Windows.
.
The primary features of Byline include printing messages, prompting
for input, and generating custom menus. It was inspired by the
@highline@ Ruby library and the @terminal@ library by Craig Roche.
.
== Example
.
> example :: MonadByline m => m Text
> example = do
> sayLn ("Hey, I like " <> ("Haskell" <> fg magenta) <> "!")
>
> let question =
> "What's "
> <> ("your" <> bold)
> <> " favorite "
> <> ("language" <> fg green <> underline)
> <> "? "
>
> askLn question (Just "Haskell")
.
<<https://github.com/pjones/byline/raw/trunk/doc/demo.png>>
--------------------------------------------------------------------------------
extra-source-files:
CHANGES.md
examples/*.hs
README.md
--------------------------------------------------------------------------------
source-repository head
type: git
location: https://github.com/pjones/byline.git
--------------------------------------------------------------------------------
flag build-examples
description: Build examples when building the library.
manual: True
default: False
--------------------------------------------------------------------------------
common options
default-language: Haskell2010
default-extensions:
DefaultSignatures
DeriveFoldable
DeriveFunctor
DeriveTraversable
DerivingStrategies
ExistentialQuantification
FlexibleContexts
FlexibleInstances
FunctionalDependencies
GeneralizedNewtypeDeriving
InstanceSigs
KindSignatures
LambdaCase
MultiParamTypeClasses
NamedFieldPuns
OverloadedStrings
RankNTypes
RecordWildCards
ScopedTypeVariables
TupleSections
TypeFamilies
ghc-options:
-Wall -Wno-name-shadowing -Werror=incomplete-record-updates
-Werror=incomplete-uni-patterns -Werror=missing-home-modules
-Widentities -Wmissing-export-lists -Wredundant-constraints
--------------------------------------------------------------------------------
common dependencies
build-depends:
, ansi-terminal >=0.6 && <0.12
, attoparsec >=0.13 && <0.15
, base >=4.9 && <5.0
, colour ^>=2.3
, exceptions >=0.8 && <0.11
, free ^>=5.1
, haskeline >=0.8 && <0.8.3
, mtl >=2.1 && <2.4
, optparse-applicative ^>=0.17
, relude >=0.6 && <1.3
, terminfo-hs >=0.1 && <0.3
, text >=0.11 && <2.1
mixins:
base hiding (Prelude),
relude (Relude as Prelude, Relude.Extra.Map)
--------------------------------------------------------------------------------
library
import: options, dependencies
hs-source-dirs: src
exposed-modules:
Byline
Byline.Completion
Byline.Exit
Byline.Internal.Color
Byline.Internal.Completion
Byline.Internal.Eval
Byline.Internal.Prim
Byline.Internal.Simulation
Byline.Internal.Stylized
Byline.Internal.Types
Byline.Menu
Byline.Shell
Byline.Simulation
------------------------------------------------------------------------------
test-suite test
import: options, dependencies
type: exitcode-stdio-1.0
hs-source-dirs: test
main-is: Main.hs
build-depends:
, byline
, tasty >=1.2
, tasty-hunit ^>=0.10
--------------------------------------------------------------------------------
executable demo
import: options, dependencies
main-is: examples/demo.hs
build-depends: byline
if !flag(build-examples)
buildable: False
--------------------------------------------------------------------------------
executable simple
import: options, dependencies
main-is: examples/simple.hs
build-depends: byline
if !flag(build-examples)
buildable: False
--------------------------------------------------------------------------------
executable menu
import: options, dependencies
main-is: examples/menu.hs
build-depends: byline
if !flag(build-examples)
buildable: False
--------------------------------------------------------------------------------
executable shell
import: options, dependencies
main-is: examples/shell.hs
build-depends: byline
if !flag(build-examples)
buildable: False
--------------------------------------------------------------------------------
executable colors
import: options, dependencies
main-is: examples/colors.hs
build-depends: byline
if !flag(build-examples)
buildable: False