Skip to content

Commit

Permalink
feat(cli): added -v / --version switch on the commandline, to retriev…
Browse files Browse the repository at this point in the history
…e the version of the binary
  • Loading branch information
will-moss committed Nov 29, 2024
1 parent a5e5e5b commit 5bc5935
Show file tree
Hide file tree
Showing 6 changed files with 1,571 additions and 1,856 deletions.
10 changes: 10 additions & 0 deletions app/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,16 @@ func performVerifications() error {

// Entrypoint
func main() {
// Handle commandline arguments if any
args := os.Args[1:]
if len(args) > 0 {
// Handle -v / --version switch
if args[0] == "-v" || args[0] == "--version" {
fmt.Printf("Version: -VERSION-")
return
}
}

// Load default settings via default.env file (workaround since the file is embed)
defaultSettings, _ := godotenv.Unmarshal(defaultEnv)
for k, v := range defaultSettings {
Expand Down
Loading

0 comments on commit 5bc5935

Please sign in to comment.