Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodocument vars/features #15

Open
MatthewCroughan opened this issue May 19, 2023 · 2 comments
Open

Autodocument vars/features #15

MatthewCroughan opened this issue May 19, 2023 · 2 comments

Comments

@MatthewCroughan
Copy link
Contributor

When making additional envvars that control the program/code flow like cac2be7 it is important to consider that it is not automatically documenting itself or making itself known in anyway.

It might be possible to make a rust function that mandates a documentation string, and that could be printed in some way by the program, imagine stardust-xr-server --list-vars. The way --list-vars could be populated is by a function like stardustxr_make_feature which would take a documentation string and env var as arguments, therefore making it impossible to make an envvar lookup that doesn't document itself and make itself known within the code.

@Sntx626
Copy link

Sntx626 commented Mar 4, 2024

Should a config struct be introduced that is build from cli args, env vars and config files to solve this?
This struct could easily be (self-) documented and extended. It would also encapsulate all configuration.

@Sntx626
Copy link

Sntx626 commented Mar 4, 2024

There are already proven crates that we could use to achive this, i.e. config and figment.

If there's interest for something like it, I'd be willing to implement a draft PR with this feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants