Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alecthomas/kong-toml
Kong configuration loader for TOML
https://github.com/alecthomas/kong-toml
Last synced: 16 days ago
JSON representation
Kong configuration loader for TOML
- Host: GitHub
- URL: https://github.com/alecthomas/kong-toml
- Owner: alecthomas
- License: mit
- Created: 2023-09-22T03:14:55.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2024-04-18T21:19:59.000Z (7 months ago)
- Last Synced: 2024-10-10T16:06:53.349Z (about 1 month ago)
- Language: Shell
- Size: 4.88 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: COPYING
Awesome Lists containing this project
README
# TOML Configuration Loader for [Kong](https://github.com/alecthomas/kong)
Usage:
```go
kctx := kong.Parse(&cli, kong.Configuration(kongtoml.Loader, ".app.toml", "~/.app.toml"))
```## Configuration mapping
Mapping is achieved by normalising both flags and configuration entries to
hyphen-separated keys.eg. the flag `ftl init go --no-hermit` will be mapped to the configuration key
`init-go-no-hermit = true`, with fallback to `no-hermit = true`.TOML sections are prefixed to attributes via concatenation with `-`. eg.
```toml
["init go"]
no-hermit = true
```Will be mapped to `init-go-no-hermit = true`