jooby-project / jooby

The modular web framework for Java and Kotlin
https://jooby.io
Apache License 2.0
1.71k stars 197 forks source link

[documentation] Using Lightbend's "Config Library" could have more examples #752

Closed paul-hammant closed 7 years ago

paul-hammant commented 7 years ago

One that is missing, is how to connect command-line arguments to the result of require(Config.class).

Lightbend's own documentation doesn't show that either.

jknack commented 7 years ago

Command-line arguments are documented here: http://jooby.org/doc/#conf-env-and-logging-precedence

paul-hammant commented 7 years ago

Suggestion:

automatically translate to: java -jar myapp.jar application.port=8888 application.path=/myapp and be accessed in the application, like so:

Config cfg = require(Config.class);
String myPath = cfg.get("application.path")
// more examples in Lightbend's Config documentation above

It is couple of the lines of Java code that is missing from the conf-env-and-logging-precedence section.