dbcli / dbcli/mssql-cli

Provide the ability to set configuration values via command line

Offen
#538 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
1.4k
Forks
191
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

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](https://git-scm.com/docs/git), or Mercurial, which provides the `--config` [option](https://man7.org/linux/man-pages/man1/hg.1.html). 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.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Beginne damit, die Verarbeitung der Befehlszeilenoptionen und das Laden der Konfiguration in mssql-cli zu lokalisieren, einschließlich des Pfads --mssqlclirc. Verfolge, wie Konfigurationsquellen angewendet werden, und definiere die Priorität für --c/--config name=value-Überschreibungen. Als abgeschlossen gilt die Aufgabe, wenn Automatisierung Konfigurationswerte für eine einzelne Ausführung bereitstellen kann, ohne eine separate Konfigurationsdatei zu erstellen.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli, databases
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.