Skip to content

Commit

Permalink
feat: show version when meeting -v/--version args
Browse files Browse the repository at this point in the history
  • Loading branch information
duruyao committed Nov 16, 2021
1 parent 4d76fdf commit 375068f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,20 @@ package main
import (
"flag"
"fmt"
"os"
)

var quit = make(chan struct{})
var servAddr = flag.String("a", "127.0.0.1:8080", "listening address in \"<ip>:<port>\" format")
var filePath = flag.String("f", UserHomeDir(), "handling local file path in \"/.../<path>\" format")

func main() {
for _, arg := range os.Args[1:] {
if arg == "-v" || arg == "-version" {
fmt.Println("2021.11.16.0")
return
}
}
flag.Parse()
fmt.Printf("GoFS is listening on %s and handling %s ...\n", *servAddr, *filePath)
go GoRunWebApp(*servAddr, *filePath)
Expand Down

0 comments on commit 375068f

Please sign in to comment.