Skip to content

Use new spago & upgrade to latest package set #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Dec 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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