From d19fe6e774cf9d1614df4676d12c5ab5a76cf35a Mon Sep 17 00:00:00 2001 From: Jyotika Garg Date: Thu, 25 May 2023 06:55:11 +0530 Subject: [PATCH 1/2] removing extra screenwidth entry --- cmd/sqlcmd/sqlcmd.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cmd/sqlcmd/sqlcmd.go b/cmd/sqlcmd/sqlcmd.go index 4c509948..15c91343 100644 --- a/cmd/sqlcmd/sqlcmd.go +++ b/cmd/sqlcmd/sqlcmd.go @@ -232,8 +232,10 @@ func setFlags(rootCmd *cobra.Command, args *SQLCmdArguments) { // Using PersistentFlags() for ErrorSeverityLevel due to data type uint8 , which is not supported in Flags() rootCmd.PersistentFlags().Uint8VarP(&args.ErrorSeverityLevel, "error-severity-level", "V", 0, "Controls the severity level that is used to set the ERRORLEVEL variable on exit.") - screenWidth := rootCmd.Flags().Int("screen-width", 0, "Specifies the screen width for output") - rootCmd.Flags().IntVarP(screenWidth, "w", "w", 0, "Specifies the screen width for output") + + var screenWidth int + screenWidthPtr := &screenWidth + rootCmd.Flags().IntVarP(screenWidthPtr, "screen-width", "w", 0, "Specifies the screen width for output") } func normalizeFlags(rootCmd *cobra.Command) error { From 92250fabf0ba02bea91b6f7ed4b54905cd0c94b1 Mon Sep 17 00:00:00 2001 From: Jyotika Garg Date: Fri, 26 May 2023 14:52:35 +0530 Subject: [PATCH 2/2] adding localizer --- cmd/sqlcmd/sqlcmd.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/sqlcmd/sqlcmd.go b/cmd/sqlcmd/sqlcmd.go index 15c91343..38bd0c57 100644 --- a/cmd/sqlcmd/sqlcmd.go +++ b/cmd/sqlcmd/sqlcmd.go @@ -235,7 +235,7 @@ func setFlags(rootCmd *cobra.Command, args *SQLCmdArguments) { var screenWidth int screenWidthPtr := &screenWidth - rootCmd.Flags().IntVarP(screenWidthPtr, "screen-width", "w", 0, "Specifies the screen width for output") + rootCmd.Flags().IntVarP(screenWidthPtr, "screen-width", "w", 0, localizer.Sprintf("Specifies the screen width for output")) } func normalizeFlags(rootCmd *cobra.Command) error {