Fix cmdline parsing to support more situations (bnc#889241)