[#110] Move CLI parsing helpers to the library
Description
Problem: we have some generally useful things like
addressOption
and maybeAddDefault
in Main
, they
can't be reused in other packages and we tend to copy-paste.
Also some code for CLI parsing is in private repos, we'd like to
open source it.
Solution: create Util.Named
, move maybeAddDefault
there along with
numeruous parsers. Also add namedParser
there, we do not use it in
morley
, but it is used in several private repos and is generally
useful, so we want to open-source and reuse it.
Note: outputOption
is not there because "Nothing
means stdout
"
behavior is not quite conventional one, AFAIK it's common to pass -
to request stdout
.
Related issue(s)
Resolves #110 (closed)
✅ Checklist for your Merge Request
Related changes (conditional)
-
Tests (see short guidelines)
-
If I added new functionality, I added tests covering it. -
If I fixed a bug, I added a regression test to prevent the bug from silently reappearing again.
-
-
Documentation
Stylistic guide (mandatory)
-
My commits comply with the following policy. -
My code complies with the style guide.