mirror of
https://github.com/taigrr/go-selfupdate
synced 2025-01-18 04:33:12 -08:00
Command now prints usage when no args present
This commit is contained in:
parent
b85251ea2a
commit
680cf63f34
12
main.go
12
main.go
@ -123,9 +123,21 @@ func createUpdate(path string, platform string) {
|
||||
}
|
||||
}
|
||||
|
||||
func printUsage() {
|
||||
fmt.Println("Go-Selfupdate - Enable your Golang applications to self update.\n\n")
|
||||
fmt.Println("Usage:\n")
|
||||
fmt.Println("\tSingle platform: go-selfupdate myapp 1.2")
|
||||
fmt.Println("\tCross platform: go-selfupdate /tmp/mybinares/ 1.2")
|
||||
}
|
||||
|
||||
func main() {
|
||||
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
|
||||
|
||||
if len(os.Args) < 2 {
|
||||
printUsage()
|
||||
os.Exit(0)
|
||||
}
|
||||
|
||||
appPath = os.Args[1]
|
||||
version = os.Args[2]
|
||||
genDir = "public"
|
||||
|
Loading…
x
Reference in New Issue
Block a user