use `switch' instead of `if' clauses when parsing arguments