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

Add product name and description to output #452

Merged
3 changes: 2 additions & 1 deletion cmd/modern/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,10 @@ func (c *Root) DefineCommand(...cmdparser.CommandOptions) {
}

const feedbackUrl = "https://github.com/microsoft/go-sqlcmd/issues/new"

commandOptions := cmdparser.CommandOptions{
Use: "sqlcmd",
Short: localizer.Sprintf(`sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools
Short: localizer.ProductBanner() + localizer.Sprintf(`

Feedback:
%s`, feedbackUrl),
Expand Down
10 changes: 7 additions & 3 deletions cmd/sqlcmd/sqlcmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,10 @@ func Execute(version string) {
setVars(vars, &args)

if args.Version {
fmt.Printf("%v\n", version)
fmt.Println(localizer.ProductBanner())
fmt.Println()
fmt.Printf("Version: %v\n", version)
fmt.Println()
fmt.Println(localizer.Sprintf("Legal docs and information: aka.ms/SqlcmdLegal"))
fmt.Println(localizer.Sprintf("Third party notices: aka.ms/SqlcmdNotices"))
os.Exit(0)
Expand All @@ -246,8 +249,9 @@ func Execute(version string) {
}
setFlags(rootCmd, &args)
rootCmd.SetHelpFunc(func(cmd *cobra.Command, argss []string) {
fmt.Println(cmd.Long)
fmt.Println(localizer.Sprintf("Version %v\n", version))
fmt.Println(localizer.ProductBanner())
fmt.Println()
fmt.Println(localizer.Sprintf("Version: %v\n", version))
cmd.Flags().SetInterspersed(false)
fmt.Println(localizer.Sprintf("Flags:"))
cmd.Flags().VisitAll(func(flag *pflag.Flag) {
Expand Down
5 changes: 5 additions & 0 deletions internal/localizer/localizer.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,8 @@ func Errorf(format string, a ...any) error {
func Sprintf(key message.Reference, args ...interface{}) string {
return Translator.Sprintf(key, args...)
}

// ProductBanner() returns the localized product banner string
func ProductBanner() string {
return Sprintf("sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools")
}
6,472 changes: 3,234 additions & 3,238 deletions internal/translations/catalog.go

Large diffs are not rendered by default.

25 changes: 13 additions & 12 deletions internal/translations/locales/de-DE/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"translation": "sqlcmd: SQL Server, Azure SQL und Tools installieren/erstellen/abfragen\n\nFeedback:\n {FeedbackUrl}",
"translatorComment": "Copied from source.",
"id": "Feedback:\n {FeedbackUrl}",
"message": "Feedback:\n {FeedbackUrl}",
"translation": "",
"placeholders": [
{
"id": "FeedbackUrl",
Expand All @@ -29,8 +28,7 @@
"argNum": 1,
"expr": "feedbackUrl"
}
],
"fuzzy": true
]
},
{
"id": "help for backwards compatibility flags (-S, -U, -E etc.)",
Expand Down Expand Up @@ -2487,10 +2485,9 @@
"fuzzy": true
},
{
"id": "Version {Version}",
"message": "Version {Version}",
"translation": "Version {Version}",
"translatorComment": "Copied from source.",
"id": "Version: {Version}",
"message": "Version: {Version}",
"translation": "",
"placeholders": [
{
"id": "Version",
Expand All @@ -2500,8 +2497,7 @@
"argNum": 1,
"expr": "version"
}
],
"fuzzy": true
]
},
{
"id": "Flags:",
Expand Down Expand Up @@ -3278,6 +3274,11 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translation": ""
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down
19 changes: 13 additions & 6 deletions internal/translations/locales/en-US/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"translation": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"id": "Feedback:\n {FeedbackUrl}",
"message": "Feedback:\n {FeedbackUrl}",
"translation": "Feedback:\n {FeedbackUrl}",
"translatorComment": "Copied from source.",
"placeholders": [
{
Expand Down Expand Up @@ -2487,9 +2487,9 @@
"fuzzy": true
},
{
"id": "Version {Version}",
"message": "Version {Version}",
"translation": "Version {Version}",
"id": "Version: {Version}",
"message": "Version: {Version}",
"translation": "Version: {Version}",
"translatorComment": "Copied from source.",
"placeholders": [
{
Expand Down Expand Up @@ -3278,6 +3278,13 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translation": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down
25 changes: 13 additions & 12 deletions internal/translations/locales/es-ES/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"translation": "ssqlcmd: Instalar/Crear/Consultar SQL Server, Azure SQL y Herramientas\n\nComentarios:\n {FeedbackUrl}",
"translatorComment": "Copied from source.",
"id": "Feedback:\n {FeedbackUrl}",
"message": "Feedback:\n {FeedbackUrl}",
"translation": "",
"placeholders": [
{
"id": "FeedbackUrl",
Expand All @@ -29,8 +28,7 @@
"argNum": 1,
"expr": "feedbackUrl"
}
],
"fuzzy": true
]
},
{
"id": "help for backwards compatibility flags (-S, -U, -E etc.)",
Expand Down Expand Up @@ -2487,10 +2485,9 @@
"fuzzy": true
},
{
"id": "Version {Version}",
"message": "Version {Version}",
"translation": "Versión {Version}",
"translatorComment": "Copied from source.",
"id": "Version: {Version}",
"message": "Version: {Version}",
"translation": "",
"placeholders": [
{
"id": "Version",
Expand All @@ -2500,8 +2497,7 @@
"argNum": 1,
"expr": "version"
}
],
"fuzzy": true
]
},
{
"id": "Flags:",
Expand Down Expand Up @@ -3278,6 +3274,11 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translation": ""
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down
25 changes: 13 additions & 12 deletions internal/translations/locales/fr-FR/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"translation": "sqlcmd : installer/créer/interroger SQL Server, Azure SQL et les outils\n\nRetour:\n {FeedbackUrl}",
"translatorComment": "Copied from source.",
"id": "Feedback:\n {FeedbackUrl}",
"message": "Feedback:\n {FeedbackUrl}",
"translation": "",
"placeholders": [
{
"id": "FeedbackUrl",
Expand All @@ -29,8 +28,7 @@
"argNum": 1,
"expr": "feedbackUrl"
}
],
"fuzzy": true
]
},
{
"id": "help for backwards compatibility flags (-S, -U, -E etc.)",
Expand Down Expand Up @@ -2487,10 +2485,9 @@
"fuzzy": true
},
{
"id": "Version {Version}",
"message": "Version {Version}",
"translation": "Version {Version}",
"translatorComment": "Copied from source.",
"id": "Version: {Version}",
"message": "Version: {Version}",
"translation": "",
"placeholders": [
{
"id": "Version",
Expand All @@ -2500,8 +2497,7 @@
"argNum": 1,
"expr": "version"
}
],
"fuzzy": true
]
},
{
"id": "Flags:",
Expand Down Expand Up @@ -3278,6 +3274,11 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translation": ""
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down
25 changes: 13 additions & 12 deletions internal/translations/locales/it-IT/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"translation": "sqlcmd: installare/creare/eseguire query su SQL Server, Azure SQL e strumenti\n\nFeedback:\n {FeedbackUrl}",
"translatorComment": "Copied from source.",
"id": "Feedback:\n {FeedbackUrl}",
"message": "Feedback:\n {FeedbackUrl}",
"translation": "",
"placeholders": [
{
"id": "FeedbackUrl",
Expand All @@ -29,8 +28,7 @@
"argNum": 1,
"expr": "feedbackUrl"
}
],
"fuzzy": true
]
},
{
"id": "help for backwards compatibility flags (-S, -U, -E etc.)",
Expand Down Expand Up @@ -2487,10 +2485,9 @@
"fuzzy": true
},
{
"id": "Version {Version}",
"message": "Version {Version}",
"translation": "Versione {Version}",
"translatorComment": "Copied from source.",
"id": "Version: {Version}",
"message": "Version: {Version}",
"translation": "",
"placeholders": [
{
"id": "Version",
Expand All @@ -2500,8 +2497,7 @@
"argNum": 1,
"expr": "version"
}
],
"fuzzy": true
]
},
{
"id": "Flags:",
Expand Down Expand Up @@ -3278,6 +3274,11 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translation": ""
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down
25 changes: 13 additions & 12 deletions internal/translations/locales/ja-JP/out.gotext.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools\n\nFeedback:\n {FeedbackUrl}",
"translation": "sqlcmd: SQL Server、Azure SQL、およびツールのインストール/作成/クエリ\n\nフィードバック:\n {FeedbackUrl}",
"translatorComment": "Copied from source.",
"id": "Feedback:\n {FeedbackUrl}",
"message": "Feedback:\n {FeedbackUrl}",
"translation": "",
"placeholders": [
{
"id": "FeedbackUrl",
Expand All @@ -29,8 +28,7 @@
"argNum": 1,
"expr": "feedbackUrl"
}
],
"fuzzy": true
]
},
{
"id": "help for backwards compatibility flags (-S, -U, -E etc.)",
Expand Down Expand Up @@ -2487,10 +2485,9 @@
"fuzzy": true
},
{
"id": "Version {Version}",
"message": "Version {Version}",
"translation": "バージョン {Version}",
"translatorComment": "Copied from source.",
"id": "Version: {Version}",
"message": "Version: {Version}",
"translation": "",
"placeholders": [
{
"id": "Version",
Expand All @@ -2500,8 +2497,7 @@
"argNum": 1,
"expr": "version"
}
],
"fuzzy": true
]
},
{
"id": "Flags:",
Expand Down Expand Up @@ -3278,6 +3274,11 @@
"translatorComment": "Copied from source.",
"fuzzy": true
},
{
"id": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"message": "sqlcmd: Install/Create/Query SQL Server, Azure SQL, and Tools",
"translation": ""
},
{
"id": "Sqlcmd: Error:",
"message": "Sqlcmd: Error:",
Expand Down
Loading
Loading