diff --git a/README.md b/README.md index e4a1e35d..8cbe3ba7 100644 --- a/README.md +++ b/README.md @@ -82,6 +82,18 @@ sqlcmd config connection-strings sqlcmd config view ``` +#### Custom Configuration Files + +You can specify a custom configuration file using the `--sqlconfig` flag. Configuration files must be in **YAML format** and use the `.yaml` or `.yml` file extension. + +Example: +``` +sqlcmd config --sqlconfig ./myproject.yaml add-endpoint --name ep1434 --address localhost --port 1434 +sqlcmd config --sqlconfig ./myproject.yaml view +``` + +**Note:** The default configuration file at `~/.sqlcmd/sqlconfig` is an exception and uses YAML format without an extension. When specifying a custom configuration file, always use the `.yaml` or `.yml` extension to avoid errors. + ### Versions To see all version tags to choose from (2017, 2019, 2022 etc.), and install a specific version, run: diff --git a/cmd/modern/root.go b/cmd/modern/root.go index 8a83f02b..2b341d63 100644 --- a/cmd/modern/root.go +++ b/cmd/modern/root.go @@ -121,7 +121,7 @@ func (c *Root) addGlobalFlags() { String: &c.configFilename, DefaultString: config.DefaultFileName(), Name: "sqlconfig", - Usage: localizer.Sprintf("configuration file"), + Usage: localizer.Sprintf("configuration file (YAML format, use .yaml or .yml extension)"), }) /* BUG(stuartpa): - At the moment this is a top level flag, but it doesn't diff --git a/internal/translations/locales/de-DE/out.gotext.json b/internal/translations/locales/de-DE/out.gotext.json index d54f16aa..a8a31690 100644 --- a/internal/translations/locales/de-DE/out.gotext.json +++ b/internal/translations/locales/de-DE/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/en-US/out.gotext.json b/internal/translations/locales/en-US/out.gotext.json index b2573d2f..54525ad9 100644 --- a/internal/translations/locales/en-US/out.gotext.json +++ b/internal/translations/locales/en-US/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3741,4 +3748,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/es-ES/out.gotext.json b/internal/translations/locales/es-ES/out.gotext.json index a33b8514..59688473 100644 --- a/internal/translations/locales/es-ES/out.gotext.json +++ b/internal/translations/locales/es-ES/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/fr-FR/out.gotext.json b/internal/translations/locales/fr-FR/out.gotext.json index aaffe94b..0e1de746 100644 --- a/internal/translations/locales/fr-FR/out.gotext.json +++ b/internal/translations/locales/fr-FR/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/it-IT/out.gotext.json b/internal/translations/locales/it-IT/out.gotext.json index 2dbfe8b6..f8715920 100644 --- a/internal/translations/locales/it-IT/out.gotext.json +++ b/internal/translations/locales/it-IT/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/ja-JP/out.gotext.json b/internal/translations/locales/ja-JP/out.gotext.json index 4abf45ee..12071d85 100644 --- a/internal/translations/locales/ja-JP/out.gotext.json +++ b/internal/translations/locales/ja-JP/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/ko-KR/out.gotext.json b/internal/translations/locales/ko-KR/out.gotext.json index 45061b33..2b933b0f 100644 --- a/internal/translations/locales/ko-KR/out.gotext.json +++ b/internal/translations/locales/ko-KR/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/pt-BR/out.gotext.json b/internal/translations/locales/pt-BR/out.gotext.json index 8eff2140..cd4fe873 100644 --- a/internal/translations/locales/pt-BR/out.gotext.json +++ b/internal/translations/locales/pt-BR/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/ru-RU/out.gotext.json b/internal/translations/locales/ru-RU/out.gotext.json index 01ff5de8..7d970f47 100644 --- a/internal/translations/locales/ru-RU/out.gotext.json +++ b/internal/translations/locales/ru-RU/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/zh-CN/out.gotext.json b/internal/translations/locales/zh-CN/out.gotext.json index 95406ea1..a38d8a37 100644 --- a/internal/translations/locales/zh-CN/out.gotext.json +++ b/internal/translations/locales/zh-CN/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +} diff --git a/internal/translations/locales/zh-TW/out.gotext.json b/internal/translations/locales/zh-TW/out.gotext.json index bda7c2a9..f0710386 100644 --- a/internal/translations/locales/zh-TW/out.gotext.json +++ b/internal/translations/locales/zh-TW/out.gotext.json @@ -53,6 +53,13 @@ "translatorComment": "Copied from source.", "fuzzy": true }, + { + "id": "configuration file (YAML format, use .yaml or .yml extension)", + "message": "configuration file (YAML format, use .yaml or .yml extension)", + "translation": "configuration file (YAML format, use .yaml or .yml extension)", + "translatorComment": "Copied from source.", + "fuzzy": true + }, { "id": "log level, error=0, warn=1, info=2, debug=3, trace=4", "message": "log level, error=0, warn=1, info=2, debug=3, trace=4", @@ -3737,4 +3744,4 @@ "fuzzy": true } ] -} \ No newline at end of file +}