Version and help commands.

This commit is contained in:
Justin Hawkins
2017-02-21 12:28:26 +10:30
parent 699ca9fcfc
commit cb1f1d1a05
2 changed files with 15 additions and 2 deletions

8
dau.go
View File

@@ -96,13 +96,19 @@ func parse_options() (webhook_url string, path string, watch int, username strin
watchFlag := getopt.Int16Long ("watch", 's', 10, "time between scans")
usernameFlag := getopt.StringLong("username", 'u', "", "username for the bot upload")
helpFlag := getopt.BoolLong ("help", 'h', "help")
versionFlag := getopt.BoolLong ("version", 'v', "show version")
getopt.SetParameters("")
getopt.Parse()
if (*helpFlag) {
getopt.PrintUsage(os.Stderr)
os.Exit(1)
os.Exit(0)
}
if (*versionFlag) {
fmt.Printf("Version: %s\n", current_version)
os.Exit(0)
}
if ! getopt.IsSet("directory") {