A standard for how command line tools should do configs #3709
Replies: 2 comments 4 replies
-
Libraries should accept configuration by passing arguments into functions. Global state is an anti-pattern that makes libraries overly rigid and hard to work with. |
Beta Was this translation helpful? Give feedback.
-
I'd want to reignite this discussion with a few options that have come to mind First we have my personal favorite which is prefixing with [config.my_cli] this is concice and shows that it configs a cli tool. Otherwise we have two that are prefixing with [cli.my_cli]
[library.my_cli] Therefor i'd wager for a standardization of a |
Beta Was this translation helpful? Give feedback.
-
Gleam libraries currently have a lot of different ways to handle their configuration. I think gleam as a language should come to a consensus on how libraries should handle configs and keep it that way so any time any one wants to asks for how to configs we can point to it and say, this is how you do it.
My proposal which i know is controversial with Lpil is to handle configs in the
gleam.toml
it is a file that every gleam projects includes and already contains configuration for the language therefor I believe it is perfect.I believe reserving the
config.[package]
"namespace" for libraries will create a neat and tidy configuration structure for gleam going forward. I am open to change however I just want Gleam to get ahead of this before we a get a javascript like solution where everyone uses different languages and naming schemes.Beta Was this translation helpful? Give feedback.
All reactions