reworked cmd option handling