renamed cmdArgs to opts