refactor anonymous fun() into cmd_exec with no_return() spec