From 72bf48bd30f94307ed047d01a62981b213d1c219 Mon Sep 17 00:00:00 2001 From: Juan Garrido Date: Wed, 1 Mar 2023 11:26:42 +0100 Subject: [PATCH] sqlfmt: add flag version --- Makefile | 2 +- README.md | 1 + internal/cli/sqlfmt.go | 9 +++++---- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 078159c..75826cc 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ SHELL = /bin/bash -VERSION = v1.5.0 +VERSION = v1.5.1 BUILDER = docker.elastic.co/beats-dev/golang-crossbuild:1.19-$$BUILDER_TAG-debian10 BUILD_TARGETS = linux/amd64 windows/amd64 darwin/amd64 darwin/arm64 diff --git a/README.md b/README.md index 59c62d0..882124d 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,7 @@ Flags: --no-simplify Don't simplify output. --tab-width int Number of spaces per indentation level. (default 4) --use-spaces Indent with spaces instead of tabs. + -v, --version version for sqlfmt ``` ## Examples diff --git a/internal/cli/sqlfmt.go b/internal/cli/sqlfmt.go index f2a14f4..22150c7 100644 --- a/internal/cli/sqlfmt.go +++ b/internal/cli/sqlfmt.go @@ -66,10 +66,11 @@ var sqlfmtCtx struct { // NewSqlfmtCmd create and returns the sqlfmt command func NewSqlfmtCmd() *cobra.Command { sqlfmtCmd := &cobra.Command{ - Use: "sqlfmt", - Short: "format SQL statements", - Long: "Formats SQL statements from stdin to line length n.", - RunE: runSQLFmt, + Use: "sqlfmt", + Version: "1.5.1", + Short: "format SQL statements", + Long: "Formats SQL statements from stdin to line length n.", + RunE: runSQLFmt, } cfg := tree.DefaultPrettyCfg()