geoipupdate output written to stderr instead of stdout
All geoipupdate output is written to stderr instead of stdout, even on success:
{ { geoipupdate --version; } 2>&3 | sed 's/^/STDOUT: /'; } 3>&1 1>&2 | sed 's/^/STDERR: /' { { geoipupdate -h; } 2>&3 | sed 's/^/STDOUT: /'; } 3>&1 1>&2 | sed 's/^/STDERR: /'
Yeah, I agree this is kind of odd, although I'm not sure it is technically wrong. It is a result of using Go's default logger. I'm not sure we'd want to change it at this point. #119 is related.
Technically I think nothing is wrong. But from an automation perspective this doesn't make sense. If lasterror is 0 the version should be printed to stdout. Currently hard to process output in scripts since you need to capture both stdin and stderr to see if any output is generated independent on the error code
Are you wanting to run --version automatically? We don't print any output unless it's an error (with non exit status 0) when run normally I believe.
Using --version to detect if an new version should be installed
using it in PowerShell code