konfig icon indicating copy to clipboard operation
konfig copied to clipboard

Document how to use CLI for configuration

Open liamdawson opened this issue 9 years ago • 6 comments

I can't seem to find how to use the CLI for configuration, despite the fact the README says it's an available source.

liamdawson avatar Oct 16 '16 06:10 liamdawson

Will do.

For now, you'll have to refer to the tests. https://github.com/npryce/konfig/blob/master/src/test/kotlin/com/natpryce/konfig/cli_tests.kt

npryce avatar Feb 12 '17 10:02 npryce

I played with it a little bit and it seems that it is not possible to mark a CommandLineOption as optional. This is unfortunate especially with the possibility of using the overriding function so that proper default values can be provided through another Configuration.

Did I miss something?

StefanLiebig avatar Aug 30 '17 11:08 StefanLiebig

Use the getOrElse or getOrNull methods to get optional properties

On Wed, 30 Aug 2017 at 12:12, Stefan Liebig [email protected] wrote:

I played with it a little bit and it seems that it is not possible to mark a CommandLineOption as optional. This is unfortunate especially with the possibility of using the overriding function so that proper default values can be provided through another Configuration.

Did I miss something?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/npryce/konfig/issues/9#issuecomment-325959467, or mute the thread https://github.com/notifications/unsubscribe-auth/AADbm9Y6AoI58SSVbz2XRw-CV8vvwBltks5sdUObgaJpZM4KX5mO .

npryce avatar Aug 30 '17 11:08 npryce

Sorry, my mistake. I did not recognize that the exception I got had been caused by the property access. I thought that parsing would generate the exception.

StefanLiebig avatar Aug 30 '17 12:08 StefanLiebig

No problem. The library does need better documentation!

--Nat

On Wed, 30 Aug 2017 at 13:53, Stefan Liebig [email protected] wrote:

Sorry, my mistake. I did not recognize that the exception I got had been caused by the property access. I thought that parsing would generate the exception.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/npryce/konfig/issues/9#issuecomment-325980646, or mute the thread https://github.com/notifications/unsubscribe-auth/AADbm9BRyyJTKMMBZq7PjxOtqw_sQ--Tks5sdVsxgaJpZM4KX5mO .

npryce avatar Aug 30 '17 12:08 npryce

This was in 2017 and the documentation is still not updated, of this ticket closed.

bpappin avatar Nov 02 '21 17:11 bpappin