go-jet / jet

Type safe SQL builder with code generation and automatic query result data mapping
Apache License 2.0
2.23k stars 110 forks source link

Usage string shows hard coded version 2.8.0 #234

Closed mrityunjaygr8 closed 11 months ago

mrityunjaygr8 commented 1 year ago

Describe the bug The usage string for the cmd has hard coded version at 2.8.0, causing confusion for users.

Environment (please complete the following information):

Code snippet

func usage() {
    fmt.Println("Jet generator 2.8.0")
    fmt.Println()
    fmt.Println("Usage:")

    order := []string{
        "source", "dsn", "host", "port", "user", "password", "dbname", "schema", "params", "sslmode",
        "path",
        "ignore-tables", "ignore-views", "ignore-enums",
    }

    for _, name := range order {
        flagEntry := flag.CommandLine.Lookup(name)
        fmt.Printf("  -%s\n", flagEntry.Name)
        fmt.Printf("\t%s\n", flagEntry.Usage)
    }

    fmt.Println()
    fmt.Println(`Example command:

    $ jet -dsn=postgresql://jet:jet@localhost:5432/jetdb?sslmode=disable -schema=dvds -path=./gen
    $ jet -dsn=postgres://jet:jet@localhost:26257/jetdb?sslmode=disable -schema=dvds -path=./gen   #cockroachdb
    $ jet -source=postgres -dsn="user=jet password=jet host=localhost port=5432 dbname=jetdb" -schema=dvds -path=./gen
    $ jet -source=mysql -host=localhost -port=3306 -user=jet -password=jet -dbname=jetdb -path=./gen
    $ jet -source=sqlite -dsn="file://path/to/sqlite/database/file" -path=./gen
        `)
}

Expected behavior Usage should show the current version of the installed jet command, in my case, currently 2.10.0

go-jet commented 1 year ago

Hi @mrityunjaygr8, good catch.

go-jet commented 11 months ago

Fixed with Release v2.10.1.