Skip to content

Commit

Permalink
feat: add version flag to main.go
Browse files Browse the repository at this point in the history
- Added a `--version` flag to print the current version and exit.
- Moved the flag parsing to accommodate the new version flag.
  • Loading branch information
CoMfUcIoS committed Sep 14, 2024
1 parent ca0d6f5 commit cc7fa0c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,13 @@ import (
func main() {
var source string
var action string
var version bool

flag.StringVar(&source, "source", "", "Source file or directory to watch")
flag.StringVar(&action, "action", "", "CLI command to execute on change")
flag.Parse()
var version bool
flag.BoolVar(&version, "version", false, "Print the version and exit")
flag.Parse()

if version {
fmt.Println("Version: v0.5.0")
os.Exit(0)
Expand Down

0 comments on commit cc7fa0c

Please sign in to comment.