Added the support of -x --exclude option and some code optimization on the execute_command