I have an existing GUI mac app and I'd like to add command line call to it. For example, the GUI app called "Gallifrey" looks up the actor playing Dr. Who and optionally the companion. The GUI has a text field for year and a checkbox for "And companion" and a button to look up. From the command line, I imagine it would be:
> gallifrey -y2014 -c
> Peter Capaldi, Jenna Coleman
I found this mention of a solution on apple-dev http://lists.apple.com/archives/cocoa-dev/2009/Oct/msg01480.html
Is that still the suggested solution? I considered moving the logic into an XPC service and bundling a separate command line target, but that seems needlessly complicated.
Edit: To be clear, I'm not asking how to parse the args, I've done that, just how to decide between launching the GUI vs just returning the answer.