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

feat(CLI): add --config CLI argument #14

Open
storopoli opened this issue Mar 21, 2024 · 6 comments
Open

feat(CLI): add --config CLI argument #14

storopoli opened this issue Mar 21, 2024 · 6 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@storopoli
Copy link
Owner

Right now the config is hardcoded to be created/read in the OS-agnostic config dir.
We need a CLI argument to override it.

Something like:

dead_man_switch -c myconfig.toml
@storopoli storopoli added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Mar 21, 2024
@jaoleal
Copy link
Contributor

jaoleal commented May 13, 2024

Maybe we could rely on environment variables

use std::env;

let key = "DEAD_MAN_CONFIG";
match env::var(key) {
    Ok(val) => { do_something_with_val(val)},
    Err(e) => {do_nothing()},
}

@storopoli
Copy link
Owner Author

I don't like env vars, I want this to be a CLI argument that you can override.

@storopoli
Copy link
Owner Author

ENV vars are good for set and forget stuff. I want to be able to run several DMS with different TOML configs.

@jaoleal
Copy link
Contributor

jaoleal commented May 13, 2024

Instead of running multiple instances of DMS the --config arg can be set as a array of paths to watch and iterate over TOML configs...
This could be useful when developing the #31 daemon mode

@jaoleal
Copy link
Contributor

jaoleal commented May 13, 2024

with some good byte abstraction, all the TOMLS can be tracked and loaded in memory only retrieving the warning time and the path.

Users no more need to fit all the secrets in one toml (if using the way it should be used). Could have several tomls for each secrets

@storopoli
Copy link
Owner Author

KISS, let's first implement the simple baby-steps one config?

I don't want to overbloat this with tokio or std::threads

This was referenced May 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants