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

Provide the ability to set configuration values via command line #538

Open
davidpcaldwell opened this issue Jan 11, 2022 · 0 comments
Open

Comments

@davidpcaldwell
Copy link

davidpcaldwell commented Jan 11, 2022

It would be helpful in many automation scenarios to provide a --c / --config name=value command-line option.

In many scripting scenarios, there is the need to vary configuration values for a single invocation of mssql-cli. For example, one might want to create an API implemented in terms of mssql-cli and provide callers the ability to use arguments representing configuration values. Or one might wish to write a batch job that does some kind of extract from a database (in a particular format which differs from the default format) and sends it somewhere. Currently, the only apparent way to do this is to copy the configuration file, vary the values one wants to change, write out a new copy of the configuration file, and then use the --mssqlclirc option to use the new copy. In the second scenario a person could do this (although the batch file configuration would now be completely detached from the original and would not reflect subsequent changes). In the first scenario, a script can certainly do this, but it now needs a configuration file parser / writer, and the process is not nearly so intuitive as what other tools provide.

Compare this with git, which provides the -c option, or Mercurial, which provides the --config option. In these cases, values provided on the command line override all other configuration sources. Tools have converged on this solution because it provides maximum flexibility to callers.

@davidpcaldwell davidpcaldwell changed the title Provide the ability to set configuration files via command line Provide the ability to set configuration values via command line Jan 11, 2022
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