tonaparser: Scalable way to pass runtime configurations for tonatona

[ library, mit, system, tonatona ] [ Propose Tags ] [ Report a vulnerability ]

Tonaparser provides a way to pass runtime configurations. This library is supposed to be used with tonatona.


[Skip to Readme]

Flags

Automatic Flags
NameDescriptionDefault
buildexample

Build a small example program

Disabled

Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0
Dependencies base (>=4.14 && <4.18), envy (>=2.1 && <2.2), rio (>=0.1 && <0.2), say (>=0.1 && <0.2), tonaparser [details]
Tested with ghc ==9.4.6, ghc ==9.2.8, ghc ==9.0.2, ghc ==8.10.7
License MIT
Copyright 2018 Kadzuya Okamoto
Author Kadzuya Okamoto, Dennis Gosnell
Maintainer arow.okamoto+github@gmail.com
Category Library, System, Tonatona
Home page https://github.com/tonatona-project/tonatona#readme
Bug tracker https://github.com/tonatona-project/tonatona/issues
Source repo head: git clone https://github.com/tonatona-project/tonatona
Uploaded by arowM at 2023-08-29T14:17:43Z
Distributions
Reverse Dependencies 6 direct, 0 indirect [details]
Executables tonaparser-example
Downloads 1098 total (15 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2023-08-29 [all 1 reports]

Readme for tonaparser-0.2.0.0

[back to package description]

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"}}