Add command and real_command attributes to local return value

Issue #1078