tools/timekey: refactor command-line argument processing