Skip to content

Commit 11b66eb

Browse files
Release 0.2.0.0
2 parents a4e75f8 + 80128aa commit 11b66eb

26 files changed

+501
-76
lines changed

.github/workflows/ci.yml

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ on:
88
- main
99

1010
jobs:
11-
cabal:
11+
latest-cabal:
1212
name: "Cabal: GHC ${{ matrix.ghc }}"
1313
runs-on: ubuntu-latest
1414
strategy:
1515
matrix:
16-
ghc: ['8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.2']
16+
ghc: ['8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.4', '9.0.1']
1717
steps:
1818
- name: Checkout
1919
uses: actions/checkout@v2
2020
- name: Setup Haskell
21-
uses: actions/setup-haskell@v1.1.3
21+
uses: haskell/actions/setup@v1
2222
with:
2323
ghc-version: ${{ matrix.ghc }}
2424
cabal-version: latest
@@ -32,12 +32,12 @@ jobs:
3232
runs-on: ubuntu-latest
3333
strategy:
3434
matrix:
35-
ghc: ['8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.2']
35+
ghc: ['8.2.2', '8.4.4', '8.6.5', '8.8.4', '8.10.4']
3636
steps:
3737
- name: Checkout
3838
uses: actions/checkout@v2
3939
- name: Setup Haskell
40-
uses: actions/setup-haskell@v1.1.3
40+
uses: haskell/actions/setup@v1
4141
with:
4242
ghc-version: ${{ matrix.ghc }}
4343
cabal-version: latest
@@ -56,3 +56,22 @@ jobs:
5656
run: stack test --system-ghc
5757
env:
5858
STACK_YAML: stack-${{ matrix.ghc }}.yaml
59+
60+
cabal:
61+
name: "Cabal ${{ matrix.cabal }}: GHC 8.2.2"
62+
runs-on: ubuntu-latest
63+
strategy:
64+
matrix:
65+
cabal: ['2.4.1.0', '3.0.0.0', '3.2.0.0', '3.4.0.0']
66+
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v2
69+
- name: Setup Haskell
70+
uses: haskell/actions/setup@v1
71+
with:
72+
ghc-version: 8.2.2
73+
cabal-version: ${{ matrix.cabal }}
74+
- name: Build
75+
run: cabal new-build --enable-tests --enable-benchmarks
76+
- name: Test
77+
run: cabal new-test --enable-tests

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66
*.yaml.lock
77
stack-nix*
88

9+
# stan
10+
/.hie/
11+
912
# cabal
1013
cabal.project.local
1114
cabal.project.local~

CHANGELOG.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ following conventions:
2424

2525
[KaC]: <https://keepachangelog.com/en/1.0.0/>
2626

27+
## 0.2.0.0 (2021-05-27)
28+
29+
### Breaking
30+
31+
* Add support for `optparse-applicative` `0.16`
32+
33+
### Non-Breaking
34+
35+
* Add `.deb` and `.rpm` packaging
36+
* Add Cabal support to `Makefile`
37+
* Add Cabal tests to GitHub Actions
38+
* Add [stan](https://hackage.haskell.org/package/stan) static analysis
39+
2740
## 0.1.0.0 (2020-11-28)
2841

2942
### Breaking

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2020 Travis Cardwell
3+
Copyright (c) 2020-2021 Travis Cardwell
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

LibOA.hs

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
-- |
33
-- Module : LibOA
44
-- Description : supplementary functions for optparse-applicative
5-
-- Copyright : Copyright (c) 2019-2020 Travis Cardwell
5+
-- Copyright : Copyright (c) 2019-2021 Travis Cardwell
66
-- License : MIT
77
--
88
-- This is a collection of functions that I often use with
@@ -11,7 +11,7 @@
1111
-- projects as required. If the library grows to a substantial size or others
1212
-- with to use it, I will reconsider.
1313
--
14-
-- Revision: 2020-01-02
14+
-- Revision: 2021-04-04
1515
------------------------------------------------------------------------------
1616

1717
{-# LANGUAGE CPP #-}
@@ -55,12 +55,25 @@ import qualified Options.Applicative.Types as OAT
5555
-- This is the same as 'OA.helper' except that it has a different help
5656
-- message.
5757
helper :: OA.Parser (a -> a)
58+
#if MIN_VERSION_optparse_applicative (0,16,0)
59+
helper = OA.option helpReader $ mconcat
60+
[ OA.short 'h'
61+
, OA.long "help"
62+
, OA.help "show this help text"
63+
, OA.hidden
64+
]
65+
where
66+
helpReader = do
67+
potentialCommand <- OAT.readerAsk
68+
OA.readerAbort $ OA.ShowHelpText (Just potentialCommand)
69+
#else
5870
helper = OA.abortOption OA.ShowHelpText $ mconcat
5971
[ OA.short 'h'
6072
, OA.long "help"
6173
, OA.help "show help and exit"
6274
, OA.hidden
6375
]
76+
#endif
6477

6578
-- | A hidden @--version@ option that always fails, showing the version
6679
versioner
@@ -80,7 +93,7 @@ commands :: OA.Parser a -> [String]
8093
commands =
8194
let go _ opt = case OAT.optMain opt of
8295
OAT.CmdReader _ cmds _ -> reverse cmds
83-
_ -> []
96+
_otherReader -> []
8497
in concat . OAC.mapParser go
8598

8699
------------------------------------------------------------------------------
@@ -89,6 +102,7 @@ commands =
89102
-- | Insert a blank line between two documents
90103
(<||>) :: Doc -> Doc -> Doc
91104
d1 <||> d2 = d1 <> Doc.line <> Doc.line <> d2
105+
infixr 5 <||>
92106

93107
-- | Create a section with a title and indented body
94108
section :: String -> Doc -> Doc

0 commit comments

Comments
 (0)