Skip to content

Commit

Permalink
Merge branch 'main' into rw-0816-add-product-name-to-output
Browse files Browse the repository at this point in the history
  • Loading branch information
shueybubbles authored Oct 10, 2023
2 parents c451ca6 + 5e60d97 commit 9a78110
Show file tree
Hide file tree
Showing 48 changed files with 5,448 additions and 1,869 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,10 @@ The `sqlcmd` project aims to be a complete port of the original ODBC sqlcmd to t
The following switches have different behavior in this version of `sqlcmd` compared to the original ODBC based `sqlcmd`.
- `-R` switch is ignored. The go runtime does not provide access to user locale information, and it's not readily available through syscall on all supported platforms.
- `-I` switch is ignored; quoted identifiers are always set on. To disable quoted identifier behavior, add `SET QUOTED IDENTIFIER OFF` in your scripts.
- `-N` now takes a string value that can be one of `true`, `false`, or `disable` to specify the encryption choice.
- `-N` now takes a string value that can be one of `strict`,`true`,`mandatory`,`yes`,`1`,`t`, `optional`, `no`, `0`, `f`, `false`, or `disable` to specify the encryption choice.
- If `-N` and `-C` are not provided, sqlcmd will negotiate authentication with the server without validating the server certificate.
- If `-N` is provided but `-C` is not, sqlcmd will require validation of the server certificate. Note that a `false` value for encryption could still lead to encryption of the login packet.
- `-C` has no effect when `strict` value is specified for `-N`.
- If both `-N` and `-C` are provided, sqlcmd will use their values for encryption negotiation.
- More information about client/server encryption negotiation can be found at <https://docs.microsoft.com/openspecs/windows_protocols/ms-tds/60f56408-0188-4cd5-8b90-25c6f2423868>
- `-u` The generated Unicode output file will have the UTF16 Little-Endian Byte-order mark (BOM) written to it.
Expand Down
4 changes: 2 additions & 2 deletions cmd/sqlcmd/sqlcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -457,10 +457,10 @@ func normalizeFlags(cmd *cobra.Command) error {
case encryptConnection:
value := strings.ToLower(v)
switch value {
case "false", "true", "disable":
case "mandatory", "yes", "1", "t", "true", "disable", "optional", "no", "0", "f", "false", "strict":
return pflag.NormalizedName(name)
default:
err = invalidParameterError("-N", v, "false", "true", "disable")
err = invalidParameterError("-N", v, "mandatory", "yes", "1", "t", "true", "disable", "optional", "no", "0", "f", "false", "strict")
return pflag.NormalizedName("")
}
case format:
Expand Down
1 change: 1 addition & 0 deletions cmd/sqlcmd/sqlcmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ func TestInvalidCommandLine(t *testing.T) {
{[]string{"-P"}, "'-P': Missing argument. Enter '-?' for help."},
{[]string{"-;"}, "';': Unknown Option. Enter '-?' for help."},
{[]string{"-t", "-2"}, "'-t -2': value must be greater than or equal to 0 and less than or equal to 65534."},
{[]string{"-N", "invalid"}, "'-N invalid': Unexpected argument. Argument value has to be one of [mandatory yes 1 t true disable optional no 0 f false strict]."},
}

for _, test := range commands {
Expand Down
229 changes: 164 additions & 65 deletions internal/translations/LCL/de-DE/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/es-ES/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/fr-FR/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/it-IT/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/ja-JP/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/ko-KR/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/pt-BR/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/ru-RU/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/zh-CN/out.gotext.json.lcl

Large diffs are not rendered by default.

229 changes: 164 additions & 65 deletions internal/translations/LCL/zh-TW/out.gotext.json.lcl

Large diffs are not rendered by default.

1,823 changes: 973 additions & 850 deletions internal/translations/catalog.go

Large diffs are not rendered by default.

129 changes: 120 additions & 9 deletions internal/translations/locales/de-DE/messages.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -2661,16 +2661,26 @@
"fuzzy": true
},
{
"id": "Disables commands that might compromise system security. Sqlcmd issues a warning and continues",
"message": "Disables commands that might compromise system security. Sqlcmd issues a warning and continues",
"translation": "Deaktiviert Befehle, die die Systemsicherheit gefährden können. Sqlcmd gibt eine Warnung aus und wird fortgesetzt",
"id": "{_X1} Disables commands that might compromise system security. Passing 1 tells sqlcmd to exit when disabled commands are run.",
"message": "{_X1} Disables commands that might compromise system security. Passing 1 tells sqlcmd to exit when disabled commands are run.",
"translation": "{_X1} Deaktiviert Befehle, die die Systemsicherheit gefährden könnten. Die Übergabe 1 weist sqlcmd an, beendet zu werden, wenn deaktivierte Befehle ausgeführt werden.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_X1",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "\"-X[1]\""
}
],
"fuzzy": true
},
{
"id": "Specifies the SQL authentication method to use to connect to Azure SQL Database. One of: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, SqlPassword",
"message": "Specifies the SQL authentication method to use to connect to Azure SQL Database. One of: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, SqlPassword",
"translation": "Gibt die SQL-Authentifizierungsmethode an, die zum Herstellen einer Verbindung mit der Azure SQL-Datenbank verwendet werden soll. Eines der folgenden Elemente: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, SqlPassword",
"id": "Specifies the SQL authentication method to use to connect to Azure SQL Database. One of: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, ActiveDirectoryAzCli, ActiveDirectoryDeviceCode, SqlPassword",
"message": "Specifies the SQL authentication method to use to connect to Azure SQL Database. One of: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, ActiveDirectoryAzCli, ActiveDirectoryDeviceCode, SqlPassword",
"translation": "Gibt die SQL-Authentifizierungsmethode an, die zum Herstellen einer Verbindung mit der Azure SQL-Datenbank verwendet werden soll. Eines der folgenden Elemente: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, ActiveDirectoryAzCli, ActiveDirectoryDeviceCode, SqlPassword",
"translatorComment": "Copied from source.",
"fuzzy": true
},
Expand Down Expand Up @@ -2796,10 +2806,20 @@
"fuzzy": true
},
{
"id": "Controls which error messages are sent to stdout. Messages that have severity level greater than or equal to this level are sent",
"message": "Controls which error messages are sent to stdout. Messages that have severity level greater than or equal to this level are sent",
"translation": "Steuert, welche Fehlermeldungen an stdout gesendet werden. Nachrichten mit einem Schweregrad größer oder gleich dieser Ebene werden gesendet.",
"id": "{_r0__1} Redirects error messages with severity >= 11 output to stderr. Pass 1 to to redirect all errors including PRINT.",
"message": "{_r0__1} Redirects error messages with severity >= 11 output to stderr. Pass 1 to to redirect all errors including PRINT.",
"translation": "{_r0__1} Leitet Fehlermeldungen mit Schweregrad >= 11 Ausgabe an stderr um. Übergeben Sie 1, um alle Fehler einschließlich PRINT umzuleiten.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_r0__1",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "\"-r[0 | 1]\""
}
],
"fuzzy": true
},
{
Expand Down Expand Up @@ -2919,6 +2939,31 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "{_Lc} List servers. Pass {C} to omit 'Servers:' output.",
"message": "{_Lc} List servers. Pass {C} to omit 'Servers:' output.",
"translation": "{_Lc} Server auflisten. Übergeben Sie {C}, um die Ausgabe \"Servers:\" auszulassen.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_Lc",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "\"-L[c]\""
},
{
"id": "C",
"string": "%[2]s",
"type": "string",
"underlyingType": "string",
"argNum": 2,
"expr": "\"c\""
}
],
"fuzzy": true
},
{
"id": "Dedicated administrator connection",
"message": "Dedicated administrator connection",
Expand All @@ -2940,6 +2985,51 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "{_k_12} Remove control characters from output. Pass 1 to substitute a space per character, 2 for a space per consecutive characters",
"message": "{_k_12} Remove control characters from output. Pass 1 to substitute a space per character, 2 for a space per consecutive characters",
"translation": "{_k_12} Entfernen Sie Steuerzeichen aus der Ausgabe. Übergeben Sie 1, um ein Leerzeichen pro Zeichen zu ersetzen, 2 für ein Leerzeichen pro aufeinanderfolgende Zeichen.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_k_12",
"string": "%[1]s",
"type": "string",
"underlyingType": "string",
"argNum": 1,
"expr": "\"-k [1|2]\""
}
],
"fuzzy": true
},
{
"id": "Echo input",
"message": "Echo input",
"translation": "Echoeingabe",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Enable column encryption",
"message": "Enable column encryption",
"translation": "Spaltenverschlüsselung aktivieren",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "New password",
"message": "New password",
"translation": "Neues Kennwort",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "New password and exit",
"message": "New password and exit",
"translation": "Neues Kennwort und Beenden",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Sets the sqlcmd scripting variable {V}",
"message": "Sets the sqlcmd scripting variable {V}",
Expand Down Expand Up @@ -3181,6 +3271,13 @@
],
"fuzzy": true
},
{
"id": "Enter new password:",
"message": "Enter new password:",
"translation": "Neues Kennwort eingeben:",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down Expand Up @@ -3344,6 +3441,13 @@
],
"fuzzy": true
},
{
"id": "Timeout expired",
"message": "Timeout expired",
"translation": "Timeout abgelaufen",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Msg {Number}, Level {Class}, State {State}, Server {ServerName}, Procedure {ProcName}, Line {LineNo}{SqlcmdEol}",
"message": "Msg {Number}, Level {Class}, State {State}, Server {ServerName}, Procedure {ProcName}, Line {LineNo}{SqlcmdEol}",
Expand Down Expand Up @@ -3466,6 +3570,13 @@
],
"fuzzy": true
},
{
"id": "Password:",
"message": "Password:",
"translation": "Kennwort:",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Invalid variable identifier {Name}",
"message": "Invalid variable identifier {Name}",
Expand Down
56 changes: 40 additions & 16 deletions internal/translations/locales/de-DE/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,8 @@
{
"id": "{_X1} Disables commands that might compromise system security. Passing 1 tells sqlcmd to exit when disabled commands are run.",
"message": "{_X1} Disables commands that might compromise system security. Passing 1 tells sqlcmd to exit when disabled commands are run.",
"translation": "",
"translation": "{_X1} Deaktiviert Befehle, die die Systemsicherheit gefährden könnten. Die Übergabe 1 weist sqlcmd an, beendet zu werden, wenn deaktivierte Befehle ausgeführt werden.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_X1",
Expand All @@ -2673,12 +2674,15 @@
"argNum": 1,
"expr": "\"-X[1]\""
}
]
],
"fuzzy": true
},
{
"id": "Specifies the SQL authentication method to use to connect to Azure SQL Database. One of: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, ActiveDirectoryAzCli, ActiveDirectoryDeviceCode, SqlPassword",
"message": "Specifies the SQL authentication method to use to connect to Azure SQL Database. One of: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, ActiveDirectoryAzCli, ActiveDirectoryDeviceCode, SqlPassword",
"translation": ""
"translation": "Gibt die SQL-Authentifizierungsmethode an, die zum Herstellen einer Verbindung mit der Azure SQL-Datenbank verwendet werden soll. Eines der folgenden Elemente: ActiveDirectoryDefault, ActiveDirectoryIntegrated, ActiveDirectoryPassword, ActiveDirectoryInteractive, ActiveDirectoryManagedIdentity, ActiveDirectoryServicePrincipal, ActiveDirectoryAzCli, ActiveDirectoryDeviceCode, SqlPassword",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Tells sqlcmd to use ActiveDirectory authentication. If no user name is provided, authentication method ActiveDirectoryDefault is used. If a password is provided, ActiveDirectoryPassword is used. Otherwise ActiveDirectoryInteractive is used",
Expand Down Expand Up @@ -2804,7 +2808,8 @@
{
"id": "{_r0__1} Redirects error messages with severity \u003e= 11 output to stderr. Pass 1 to to redirect all errors including PRINT.",
"message": "{_r0__1} Redirects error messages with severity \u003e= 11 output to stderr. Pass 1 to to redirect all errors including PRINT.",
"translation": "",
"translation": "{_r0__1} Leitet Fehlermeldungen mit Schweregrad \u003e= 11 Ausgabe an stderr um. Übergeben Sie 1, um alle Fehler einschließlich PRINT umzuleiten.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_r0__1",
Expand All @@ -2814,7 +2819,8 @@
"argNum": 1,
"expr": "\"-r[0 | 1]\""
}
]
],
"fuzzy": true
},
{
"id": "Level of mssql driver messages to print",
Expand Down Expand Up @@ -2936,7 +2942,8 @@
{
"id": "{_Lc} List servers. Pass {C} to omit 'Servers:' output.",
"message": "{_Lc} List servers. Pass {C} to omit 'Servers:' output.",
"translation": "",
"translation": "{_Lc} Server auflisten. Übergeben Sie {C}, um die Ausgabe \"Servers:\" auszulassen.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_Lc",
Expand All @@ -2954,7 +2961,8 @@
"argNum": 2,
"expr": "\"c\""
}
]
],
"fuzzy": true
},
{
"id": "Dedicated administrator connection",
Expand All @@ -2980,7 +2988,8 @@
{
"id": "{_k_12} Remove control characters from output. Pass 1 to substitute a space per character, 2 for a space per consecutive characters",
"message": "{_k_12} Remove control characters from output. Pass 1 to substitute a space per character, 2 for a space per consecutive characters",
"translation": "",
"translation": "{_k_12} Entfernen Sie Steuerzeichen aus der Ausgabe. Übergeben Sie 1, um ein Leerzeichen pro Zeichen zu ersetzen, 2 für ein Leerzeichen pro aufeinanderfolgende Zeichen.",
"translatorComment": "Copied from source.",
"placeholders": [
{
"id": "_k_12",
Expand All @@ -2990,27 +2999,36 @@
"argNum": 1,
"expr": "\"-k [1|2]\""
}
]
],
"fuzzy": true
},
{
"id": "Echo input",
"message": "Echo input",
"translation": ""
"translation": "Echoeingabe",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Enable column encryption",
"message": "Enable column encryption",
"translation": ""
"translation": "Spaltenverschlüsselung aktivieren",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "New password",
"message": "New password",
"translation": ""
"translation": "Neues Kennwort",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "New password and exit",
"message": "New password and exit",
"translation": ""
"translation": "Neues Kennwort und Beenden",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Sets the sqlcmd scripting variable {V}",
Expand Down Expand Up @@ -3256,7 +3274,9 @@
{
"id": "Enter new password:",
"message": "Enter new password:",
"translation": ""
"translation": "Neues Kennwort eingeben:",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Sqlcmd: Error:",
Expand Down Expand Up @@ -3424,7 +3444,9 @@
{
"id": "Timeout expired",
"message": "Timeout expired",
"translation": ""
"translation": "Timeout abgelaufen",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Msg {Number}, Level {Class}, State {State}, Server {ServerName}, Procedure {ProcName}, Line {LineNo}{SqlcmdEol}",
Expand Down Expand Up @@ -3551,7 +3573,9 @@
{
"id": "Password:",
"message": "Password:",
"translation": ""
"translation": "Kennwort:",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Invalid variable identifier {Name}",
Expand Down
Loading

0 comments on commit 9a78110

Please sign in to comment.