This repository has been archived by the owner on Mar 25, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
develop
?If appropriate:
Have you added new tests for additional functionality?
Technically there are no additional functionality. I was aiming to not change any of the previous behavior (except fixing visible issue like
--help
is being interpreted as a file name). If it was parsing some pure data technically I can come up with a test but it would change the implementation quiet significantly. I can do this in a separate MR if you want me to.Use “optparse-applicative” library. The parser is also the spec. The same code describes the arguments and parses them. Usage info is generated automatically from the parser.
--help
and-h
are also handled automatically as a generic thing. No need to describe them separately.Initially I’ve tried to call
taskell --help
and got this in response:Which confused me. I went to look at the code to see how the arguments parsing can be improved.
Usually you parse some pure data type out from command-line arguments. And then you decide what to do with that pure data. But I parsed monadic actions directly in order to keep this implementation close to the previous one.
An example of the auto-generated usage info: