use getopt and deepcopy args