common-cli: arguments parsing improvement

Same here. Please have comment on what the logic is.