Depend on optparse-applicative instead of optparse-applicative-fork#899
Depend on optparse-applicative instead of optparse-applicative-fork#899
Conversation
| [ showHelpOnEmpty | ||
| , helpEmbedBriefDesc PP.align | ||
| , helpRenderHelp customRenderHelp | ||
| -- , helpEmbedBriefDesc PP.align |
There was a problem hiding this comment.
This PP.align value is the magical configuration bit that makes the golden files still look good. The changes in https://github.com/smelc/optparse-applicative/commits/smelc/wip-cardano-cli-usecase/ are hardcoding this configuration change for now, but my plan is to make a PR to optparse-applicative to make this configurable.
bed54fc to
3be2b7c
Compare
c7ed606 to
62b33cc
Compare
7d32504 to
13cfd22
Compare
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
|
Because That is why I'm assigning it to you @nbacquey 🙂 |
|
This will be mergeable soon: pcapriotti/optparse-applicative#494 (comment) |
|
Seems this can be finished now: https://github.com/pcapriotti/optparse-applicative/releases/tag/0.19.0 |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
13cfd22 to
b3a5035
Compare
|
We're depending on cardano-addresses now, which depends on optparse-applicative. PR blocked on: |
b3a5035 to
1394d07
Compare
1394d07 to
d4a69a0
Compare
d4a69a0 to
d09207f
Compare
6b4f5c1 to
4d76418
Compare
Jimbo4350
left a comment
There was a problem hiding this comment.
The change in the alignment is a decrease in readability IMO. Can we keep the previous alignment?
| exitWith $ ExitFailure 1 | ||
| ) | ||
|
|
||
| renderAnyCmdError :: Text -> (a -> Doc ann) -> a -> Doc ann |
There was a problem hiding this comment.
Why not import from Cardano.CLI.Type.Error.QueryCmdError?
| | cip-format | ||
| | compatible | ||
| ) | ||
| Usage: cardano-cli (address | key | node | hash | query | legacy | byron | |
There was a problem hiding this comment.
Do we want this formatting change cc: @CarlosLopezDeLara
| ] | ||
| --verification-key-file FILEPATH | ||
| --signing-key-file FILEPATH | ||
| Usage: cardano-cli address key-gen [--key-output-bech32 | |
There was a problem hiding this comment.
This seems like a decrease in readability.
There was a problem hiding this comment.
I agree.
I do like the compactness of things like:
Usage: cardano-cli conway query protocol-parameters [--cardano-mode [--epoch-slots SLOTS]] (--mainnet | --testnet-magic NATURAL) --socket-path SOCKET_PATH [--output-json | --output-yaml] [--out-file FILEPATH]
But in the other hand, the build command and others with more complex options are far too messy
Let's not merge this one. It was a good idea trying to remove the burden of maintaining the fork, but we loose readability.
f9e2513 to
5965db4
Compare
|
This PR results in decrease in readabilty, which seems to be not feasible to fix with the current version of |
Note
Requires a release of optparse-applicative > 0.18.1 to be merged
Changelog
Context
We want to get rid on our dependency to optparse-applicative-fork here: cardano-cli/cardano-cli.cabal#L245.
This PR does this, as well as showing what it happens if we take a vanilla version of
optparse-applicative. This is what the commitChanges to golden files WITHOUT change to optparse-applicativeshows.Then the last commit, named
Changes to golden files WITH change to optparse-applicativeshows what we can achieve if we tweakoptparse-applicativeslightly. In this case the changes to golden files is minimal (pipes move to the left, and then are more single line disjunctions, but they are fine IMHO).How to trust this PR
Look at the golden files. See that the end state is quite nice.
Checklist