Skip to content

Commit

Permalink
add version subcommand
Browse files Browse the repository at this point in the history
  • Loading branch information
jorgerojas26 committed Jul 10, 2024
1 parent cc9f537 commit 7817e25
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,30 @@ package main
import (
"io"
"log"
"os"

"github.com/jorgerojas26/lazysql/app"
"github.com/jorgerojas26/lazysql/components"

"github.com/go-sql-driver/mysql"
)

var version = "dev"

func main() {
mysql.SetLogger(log.New(io.Discard, "", 0))

// check if "version" arg is passed
argsWithProg := os.Args

if len(argsWithProg) > 1 {
switch argsWithProg[1] {
case "version":
println("LazySQL version: ", version)
os.Exit(0)
}
}

if err := app.App.
SetRoot(components.MainPages, true).
EnableMouse(true).
Expand Down

0 comments on commit 7817e25

Please sign in to comment.