browser exposes the Stdout and Stderr vars for consuming packages to control where its output goes. This global state serves most purposes, but doesn't suffice if a project wants different output destinations for different OpenURL calls.
Solution
Add options to the Open* functions to allow the user to configure the command's stdout and stderr.
Notes
It seems unfortunate that cmdOptions will be ignored on Windows, but the same was already true of the package's Stdout/Stderr vars. It seems quite possible the syscall used on windows doesn't have output anyway, but I'm not very familiar with it.
It's possible that changing stdout/stderr is really the only interesting thing one might want to do with CmdOption, so maybe it'd make more sense to just define an OpenOption type that just has stdout/stderr and keep exec.Command out of the API.
The changes to go.mod/go.sum occurred when I built the package with GOOS=windows. It looks like they should have been included in #27. If you'd like, I'm happy to put them up as a separate PR since they're not really part of this change, or they're also taken care of by #29, if that ever gets merged.
Problem
browser
exposes theStdout
andStderr
vars for consuming packages to control where its output goes. This global state serves most purposes, but doesn't suffice if a project wants different output destinations for differentOpenURL
calls.Solution
Add options to the
Open*
functions to allow the user to configure the command's stdout and stderr.Notes
CmdOption
, so maybe it'd make more sense to just define an OpenOption type that just has stdout/stderr and keepexec.Command
out of the API.GOOS=windows
. It looks like they should have been included in #27. If you'd like, I'm happy to put them up as a separate PR since they're not really part of this change, or they're also taken care of by #29, if that ever gets merged.