Skip to content

Commit

Permalink
fix: add version
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredLunde committed Sep 29, 2024
1 parent a88e63d commit b050eb9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,25 @@ import (
flag "github.com/spf13/pflag"
)

var (
version = "dev"
// commit = "none"
// date = "unknown"
)

func main() {
// The first argument is the path to the template file
var file string
flag.StringVarP(&file, "output", "o", ".env", "The path to output the .env file")
var versionb bool
flag.BoolVarP(&versionb, "version", "v", false, "Print the version")
flag.Parse()

if versionb {
fmt.Println(version)
os.Exit(0)
}

path := flag.Arg(0)
if path == "" {
defaultPaths := []string{".env.template", ".env.example"}
Expand Down

0 comments on commit b050eb9

Please sign in to comment.