Updated cli parser. Not fully tested.