more robust cmd-line parsing