Skip to content

Commit c4bd663

Browse files
authored
Use new spago & upgrade to latest package set (#31)
1 parent dbc4c38 commit c4bd663

File tree

4 files changed

+51
-69
lines changed

4 files changed

+51
-69
lines changed

packages.dhall

Lines changed: 0 additions & 24 deletions
This file was deleted.

spago.dhall

Lines changed: 0 additions & 40 deletions
This file was deleted.

spago.yaml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
package:
2+
dependencies:
3+
- aff: ">=7.1.0 <8.0.0"
4+
- arrays: ">=7.2.1 <8.0.0"
5+
- bifunctors: ">=6.0.0 <7.0.0"
6+
- console: ">=6.1.0 <7.0.0"
7+
- control: ">=6.0.0 <7.0.0"
8+
- effect: ">=4.0.0 <5.0.0"
9+
- either: ">=6.1.0 <7.0.0"
10+
- enums: ">=6.0.1 <7.0.0"
11+
- exists: ">=6.0.0 <7.0.0"
12+
- exitcodes: ">=4.0.0 <5.0.0"
13+
- foldable-traversable: ">=6.0.0 <7.0.0"
14+
- free: ">=7.1.0 <8.0.0"
15+
- gen: ">=4.0.0 <5.0.0"
16+
- integers: ">=6.0.0 <7.0.0"
17+
- lazy: ">=6.0.0 <7.0.0"
18+
- lists: ">=7.0.0 <8.0.0"
19+
- maybe: ">=6.0.0 <7.0.0"
20+
- newtype: ">=5.0.0 <6.0.0"
21+
- node-buffer: ">=9.0.0 <10.0.0"
22+
- node-process: ">=11.2.0 <12.0.0"
23+
- node-streams: ">=9.0.0 <10.0.0"
24+
- nonempty: ">=7.0.0 <8.0.0"
25+
- numbers: ">=9.0.1 <10.0.0"
26+
- open-memoize: ">=6.1.0 <7.0.0"
27+
- partial: ">=4.0.0 <5.0.0"
28+
- prelude: ">=6.0.1 <7.0.0"
29+
- strings: ">=6.0.1 <7.0.0"
30+
- tailrec: ">=6.1.0 <7.0.0"
31+
- transformers: ">=6.0.0 <7.0.0"
32+
- tuples: ">=7.0.0 <8.0.0"
33+
name: optparse
34+
publish:
35+
version: 5.0.1
36+
license: BSD-3-Clause
37+
location:
38+
githubOwner: "purescript-contrib"
39+
githubRepo: purescript-optparse
40+
test:
41+
dependencies: [ "quickcheck", "spec" ]
42+
main: Test.Main
43+
workspace:
44+
extra_packages: {}
45+
package_set:
46+
registry: 43.3.0

src/Options/Applicative/Extra.purs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ import Effect (Effect)
4040
import ExitCodes (ExitCode)
4141
import ExitCodes as ExitCode
4242
import Node.Encoding (Encoding(..))
43-
import Node.Process (argv, exit, stderr, stdout)
43+
import Node.Process (argv, exit', stderr, stdout)
4444
import Node.Stream as Stream
4545
import Options.Applicative.BashCompletion (bashCompletionParser)
4646
import Options.Applicative.Builder (abortOption, defaultPrefs, help, hidden, long, metavar, short)
@@ -61,10 +61,10 @@ getProgName = argv <#> \args -> fromMaybe "" do
6161
Array.last $ String.split (String.Pattern "/") executablePath
6262

6363
exitSuccess :: forall t270. Effect t270
64-
exitSuccess = exit $ fromEnum ExitCode.Success
64+
exitSuccess = exit' $ fromEnum ExitCode.Success
6565

6666
exitWith :: forall void. ExitCode -> Effect void
67-
exitWith c = exit $ fromEnum c
67+
exitWith c = exit' $ fromEnum c
6868

6969
-- | A hidden "helper" option which always fails. Use this to
7070
-- | add the `--help` flag to your CLI parser
@@ -116,12 +116,12 @@ handleParseResult (Failure failure) = do
116116
stream = case exit of
117117
ExitCode.Success -> stdout
118118
_ -> stderr
119-
void $ Stream.writeString stream UTF8 (msg <> "\n") mempty
119+
void $ Stream.writeString stream UTF8 (msg <> "\n")
120120
exitWith exit
121121
handleParseResult (CompletionInvoked compl) = do
122122
progn <- getProgName
123123
msg <- (un CompletionResult compl).execCompletion progn
124-
void $ Stream.writeString stdout UTF8 msg mempty
124+
void $ Stream.writeString stdout UTF8 msg
125125
exitSuccess
126126

127127
-- | Extract the actual result from a `ParserResult` value.

0 commit comments

Comments
 (0)