app: rework planfile parsing and update optparse usage.