darwin will not perform correctly if there are spaces in the actual
arguments, in which case a single argument will be reported as
multple. Some CGO would be needed to get around this I think.
I couldn't find any good documentation on how windows handles
command line arguments with spaces inside the actual arguments, so
this implementation merely just splits on spaces.
This allows for getting more exact information about each argument
especially if there are arguments that have spaces in them.
This was not implemented for darwin or for windows because they
both currently have not way of properly parsing the cmdline string.
Darwin parses the output of 'ps' which is already whitespace
segmented, and windows just has the cmdline string.
process.Process.uids is an array of undocumented values.
That one of them is the user that the process is running as is obvious, but what
the other two are supposed to be is AFAICT undocumented.
On Darwin, the second and third UID (out of three) seem to always be 0.
This change removes the two always-zero UIDs from the process.Process struct on
Darwin, and leaves just the one that actually identifies the user the process
is running as.
Add common.invoker interface to mock exec.Command. common.FakeInvoker returns
expected file if exists instead of invoke exec.Command.
Currenly, mocking is enabled only process.Pids(). I will expand to other funcs incrementally.