Skip to content

Commit

Permalink
Use new spago & upgrade to latest package set (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
m-bock authored Dec 11, 2023
1 parent dbc4c38 commit c4bd663
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 69 deletions.
24 changes: 0 additions & 24 deletions packages.dhall

This file was deleted.

40 changes: 0 additions & 40 deletions spago.dhall

This file was deleted.

46 changes: 46 additions & 0 deletions spago.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package:
dependencies:
- aff: ">=7.1.0 <8.0.0"
- arrays: ">=7.2.1 <8.0.0"
- bifunctors: ">=6.0.0 <7.0.0"
- console: ">=6.1.0 <7.0.0"
- control: ">=6.0.0 <7.0.0"
- effect: ">=4.0.0 <5.0.0"
- either: ">=6.1.0 <7.0.0"
- enums: ">=6.0.1 <7.0.0"
- exists: ">=6.0.0 <7.0.0"
- exitcodes: ">=4.0.0 <5.0.0"
- foldable-traversable: ">=6.0.0 <7.0.0"
- free: ">=7.1.0 <8.0.0"
- gen: ">=4.0.0 <5.0.0"
- integers: ">=6.0.0 <7.0.0"
- lazy: ">=6.0.0 <7.0.0"
- lists: ">=7.0.0 <8.0.0"
- maybe: ">=6.0.0 <7.0.0"
- newtype: ">=5.0.0 <6.0.0"
- node-buffer: ">=9.0.0 <10.0.0"
- node-process: ">=11.2.0 <12.0.0"
- node-streams: ">=9.0.0 <10.0.0"
- nonempty: ">=7.0.0 <8.0.0"
- numbers: ">=9.0.1 <10.0.0"
- open-memoize: ">=6.1.0 <7.0.0"
- partial: ">=4.0.0 <5.0.0"
- prelude: ">=6.0.1 <7.0.0"
- strings: ">=6.0.1 <7.0.0"
- tailrec: ">=6.1.0 <7.0.0"
- transformers: ">=6.0.0 <7.0.0"
- tuples: ">=7.0.0 <8.0.0"
name: optparse
publish:
version: 5.0.1
license: BSD-3-Clause
location:
githubOwner: "purescript-contrib"
githubRepo: purescript-optparse
test:
dependencies: [ "quickcheck", "spec" ]
main: Test.Main
workspace:
extra_packages: {}
package_set:
registry: 43.3.0
10 changes: 5 additions & 5 deletions src/Options/Applicative/Extra.purs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import Effect (Effect)
import ExitCodes (ExitCode)
import ExitCodes as ExitCode
import Node.Encoding (Encoding(..))
import Node.Process (argv, exit, stderr, stdout)
import Node.Process (argv, exit', stderr, stdout)
import Node.Stream as Stream
import Options.Applicative.BashCompletion (bashCompletionParser)
import Options.Applicative.Builder (abortOption, defaultPrefs, help, hidden, long, metavar, short)
Expand All @@ -61,10 +61,10 @@ getProgName = argv <#> \args -> fromMaybe "" do
Array.last $ String.split (String.Pattern "/") executablePath

exitSuccess :: forall t270. Effect t270
exitSuccess = exit $ fromEnum ExitCode.Success
exitSuccess = exit' $ fromEnum ExitCode.Success

exitWith :: forall void. ExitCode -> Effect void
exitWith c = exit $ fromEnum c
exitWith c = exit' $ fromEnum c

-- | A hidden "helper" option which always fails. Use this to
-- | add the `--help` flag to your CLI parser
Expand Down Expand Up @@ -116,12 +116,12 @@ handleParseResult (Failure failure) = do
stream = case exit of
ExitCode.Success -> stdout
_ -> stderr
void $ Stream.writeString stream UTF8 (msg <> "\n") mempty
void $ Stream.writeString stream UTF8 (msg <> "\n")
exitWith exit
handleParseResult (CompletionInvoked compl) = do
progn <- getProgName
msg <- (un CompletionResult compl).execCompletion progn
void $ Stream.writeString stdout UTF8 msg mempty
void $ Stream.writeString stdout UTF8 msg
exitSuccess

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

0 comments on commit c4bd663

Please sign in to comment.