A better place to add the name might be after the if else block using the 'cmd_name' variable. As is now though this will work as all of the wrapped commands are given a name argument.