slightly rework command line parsing code