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

Feature: Allow config overrides on command line #409

Open
nverwer opened this issue Mar 25, 2024 · 0 comments
Open

Feature: Allow config overrides on command line #409

nverwer opened this issue Mar 25, 2024 · 0 comments

Comments

@nverwer
Copy link

nverwer commented Mar 25, 2024

Ace 1.3.2

Sometimes it is useful to override the settings from config.json on the command line.
Currently, it is not possible to change the cliConfig object, because it is frozen, and I am not sure whether not freezing it will break something.

Overriding the configuration could be done by adding something like

    config: {
      isMultiple: true,
      alias: 'C',
      type: 'string'
    }

to meowOptions.
To override the options (which does not work at the moment):

  if (cli.flags.config) {
    cli.flags.config.forEach((config) => {
      const kv = config.split('=', 2);
      cliConfig[kv[0]] = JSON.parse(kv[1]);
    });
  }

I am looking at the code for the first time, so this probably does not follow coding guidelines.

Alternatively, the command line could allow individual options to be set, like --return-2-on-validation-error=true.

If someone from the ACE team gives their view on this, I could probably make a PR with the modified code.

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

1 participant