Skip to content

Commit d7ecee7

Browse files
authored
fix: add version (#3)
1 parent a88e63d commit d7ecee7

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

main.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,25 @@ import (
1919
flag "github.com/spf13/pflag"
2020
)
2121

22+
var (
23+
version = "dev"
24+
// commit = "none"
25+
// date = "unknown"
26+
)
27+
2228
func main() {
2329
// The first argument is the path to the template file
2430
var file string
2531
flag.StringVarP(&file, "output", "o", ".env", "The path to output the .env file")
32+
var versionb bool
33+
flag.BoolVarP(&versionb, "version", "v", false, "Print the version")
2634
flag.Parse()
2735

36+
if versionb {
37+
fmt.Println(version)
38+
os.Exit(0)
39+
}
40+
2841
path := flag.Arg(0)
2942
if path == "" {
3043
defaultPaths := []string{".env.template", ".env.example"}

0 commit comments

Comments
 (0)