common-cli: improve arguments parsing