cat-file: refactor --batch option parsing