make wrap and open-cmd configurable and support complex open-cmd lines