Improve cli option handling