Primary action that appends a command to the CmdBuilder.
Parameters
an optional exporting variable. If it is non-null, the results of cmd will be recorded to it. Otherwise it is null, then the cmd will be used verbatim.
lambda that constructs the command.