You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ go version
go version go1.13.8 linux/amd64
$ cd ./go/bin/ && ./SystemdJournal2Gelf --help
panic: usage: SystemdJournal2Gelf SERVER:12201 [JOURNALCTL PARAMETERS]
goroutine 1 [running]:
main.main()
~/go/src/github.com/parse-nl/SystemdJournal2Gelf/SystemdJournal2Gelf.go:164 +0x64d
$ ./SystemdJournal2Gelf localhost:12201 -- --version
Failed to add match '--version': Invalid argument
# ^^ I would expect it to be passed to journald...
$ ./SystemdJournal2Gelf localhost:12201 --version
panic: could not parse journal output: invalid character 's' looking for beginning of value
# ^^ Why?
The text was updated successfully, but these errors were encountered:
drzraf
changed the title
--help should not panic
--help should not panic & other argument-passing interrogations
May 27, 2020
I see your point but all of these issues can be explained:
--help panics because I used panic instead of fmt.Printf + os.Exit (I can fix this and you'd get the same error without the backtrace) I understand this might seem as if something went wrong
-- --version comes from journalctl: see journalctl -- --version. I see your point here as well as -- would normally be used as the option vs filter separator, but it currently isn't in this script
--version fails because this script expects JSON output. --version outputs non-json data which it cannot parse
The text was updated successfully, but these errors were encountered: