$res->{'cmd'} + unit test for RT:85912

closed previous pull request (not needed)