Version and help commands.
This commit is contained in:
parent
699ca9fcfc
commit
cb1f1d1a05
@ -42,12 +42,19 @@ and the directory to watch:
|
||||
|
||||
`--directory /some/path/here` - the directory that screenshots will appear in.
|
||||
|
||||
You will have to quote the path on windows, or anywhere where the directory path contains spaces.
|
||||
You will have to quote the path on windows, or anywhere where the directory path contains spaces. Note that
|
||||
subdirectories will also be scanned.
|
||||
|
||||
Other parameters are:
|
||||
|
||||
`--watch xx` - specify how many seconds to wait between scanning the directory. The default is 10 seconds.
|
||||
|
||||
`--username <username>` - an arbitrary string to show as the bot's username in the channel.
|
||||
|
||||
`--help` - show command line help.
|
||||
|
||||
`--version` - show the version.
|
||||
|
||||
## Limitations/bugs
|
||||
|
||||
* Only files ending jpg, gif or png are uploaded.
|
||||
|
8
dau.go
8
dau.go
@ -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") {
|
||||
|
Loading…
x
Reference in New Issue
Block a user