tonaparser

Scalable way to pass runtime configurations for tonatona

https://github.com/tonatona-project/tonatona#readme

Version on this page:0.1.0.0
LTS Haskell 14.27:0.1.0.0
Stackage Nightly 2019-09-21:0.1.0.0
Latest on Hackage:0.1.0.1

See all snapshots tonaparser appears in

MIT licensed by Kadzuya Okamoto, Dennis Gosnell
This version can be pinned in stack with:tonaparser-0.1.0.0@sha256:8b2cabc9e61dea81144a9e4f8ff8b131b7da93cec10765ae49c003f508873b85,5136

Module documentation for 0.1.0.0

tonaparser

Integrated parser library created for tonatona meta application framework.

It can construct system configuration from environment variables, command line arguments, and any IO values depends on them. See details for example/Main.hs.

Build example app

$ stack build --pedantic --flag tonaparser:buildexample tonaparser

Then check how it works with various command line options and environment variables.

$ stack exec tonaparser-example -- --new-foo 3 --bar-baz foo
Foo {foo = 3, bar = Bar {baz = "foo"}}

$ stack exec tonaparser-example -- --new-foo 3
Foo {foo = 3, bar = Bar {baz = "baz"}}

$ stack exec tonaparser-example -- --foo 3 --bar-baz foo
tonaparser-example: No required configuration for "Configuration for Foo.foo"

$ FOO=5 stack exec tonaparser-example -- --bar-baz foo
Foo {foo = 5, bar = Bar {baz = "foo"}}