on master help sign in
Merge pull request #216 from andreasabel/optparse-applicative-0.18

For `optparse-applicative-0.18`: use `pretty` instead of `text`

commit5da321d50323f25eebfd7617a22c06668219e5f8 authorMichael Snoyman <michael@snoyman.com> dateWed 14 Jun 2023, 15:44 (3 years ago) parentfe1c64a10a6955
4 files changed+16−12
.github/workflows/tests.yml+10−6 stack.yaml+1−1 yaml/exe/json2yaml.hs+3−3 yaml/exe/yaml2json.hs+2−2
.github/workflows/tests.yml+10−6
@@ -14,24 +14,28 @@ jobs:
1414 fail-fast: false
1515 matrix:
1616 os: [ubuntu-latest, macos-latest, windows-latest]
17− resolver: [nightly, lts-20, lts-15, lts-14, lts-12, lts-11, lts-9]
18− # Bugs in GHC make it crash too often to be worth running
17+ resolver: [nightly, lts-20, lts-15, lts-14, lts-12, lts-11]
1918 exclude:
20− - os: macos-latest
21− resolver: lts-9
2219 - os: windows-latest
2320 resolver: lts-15
2421 - os: windows-latest
2522 resolver: nightly
23+ include:
24+ - os: ubuntu-latest
25+ resolver: lts-9
26+ # problems on macOS and Windows (https://github.com/snoyberg/yaml/pull/216#issuecomment-1585522312)
2627
2728 steps:
2829 - name: Clone project
29− uses: actions/checkout@v2
30+ uses: actions/checkout@v3
3031
3132 - name: Cache dependencies
32− uses: actions/cache@v1
33+ if: ${{ runner.os != 'Windows' }}
34+ # Andreas Abel, 2023-06-10, switching off caching on Windows since ~/.stack is not the correct path here.
35+ uses: actions/cache@v3
3336 with:
3437 path: ~/.stack
38+ #NB: This path is not valid on Windows
3539 key: ${{ runner.os }}-${{ matrix.resolver }}-${{ hashFiles('stack.yaml') }}
3640 restore-keys: |
3741 ${{ runner.os }}-${{ matrix.resolver }}-
stack.yaml+1−1
@@ -1,4 +1,4 @@
1−resolver: lts-20.5
1+resolver: lts-20.25
22
33flags:
44 yaml:
yaml/exe/json2yaml.hs+3−3
@@ -15,7 +15,7 @@ import Options.Applicative
1515 , long, metavar, short, strArgument, strOption, value
1616 )
1717import Options.Applicative.Help.Pretty
18− ( vcat, text )
18+ ( vcat, pretty )
1919
2020import System.Exit ( die )
2121
@@ -43,11 +43,11 @@ options =
4343 <> footerDoc fdoc
4444
4545 where
46− hdoc = Just $ vcat $ map text
46+ hdoc = Just $ vcat $ map pretty
4747 [ versionText self
4848 , "Convert JSON to YAML."
4949 ]
50− fdoc = Just $ text $ concat
50+ fdoc = Just $ pretty $ concat
5151 [ "The old call pattern '"
5252 , self
5353 , " IN OUT' is also accepted, but deprecated."
yaml/exe/yaml2json.hs+2−2
@@ -17,7 +17,7 @@ import Options.Applicative
1717 , long, metavar, short, strArgument, strOption, value
1818 )
1919import Options.Applicative.Help.Pretty
20− ( vcat, text )
20+ ( vcat, pretty )
2121
2222import Common
2323 ( versionText, versionOption, numericVersionOption, dashToNothing )
@@ -43,7 +43,7 @@ options =
4343 (headerDoc hdoc)
4444
4545 where
46− hdoc = Just $ vcat $ map text
46+ hdoc = Just $ vcat $ map pretty
4747 [ versionText self
4848 , "Convert YAML to JSON."
4949 ]