write-commands: add write-result to simplify result merging.