how to make cocoa application run as a command line tool?
how to make cocoa application run as a command line tool?
- Subject: how to make cocoa application run as a command line tool?
- From: XiaoGang Li <email@hidden>
- Date: Tue, 20 Oct 2009 17:58:06 +0800
Greetings,
I have created an document-based cocoa application, now I need to
provide a command line interface for my users.
for example, users input this into the terminal:
./myApplication.app/Contents/MacOS/myApplication -c --srcFolder "A/B/C"
--dstFolder "A/B/D";
I can get the argument information through [[NSProcessInfo processInfo]
arguments] in the init method of the application
delegate, and parse the arguments, then step by step.
My question is that, I don't want the window and other document be displayed
on the screen, even the menu.
I want all the action be processed without user's interventio.
Maybe, this feature seems odd. anyway, however, user can open my application
in the Finder, and open a document to edit it. but they
also can run it like a shell command utility to do some other faceless work,
like convert the type the document to another type.
I don't know whether I have a detailed description for my issue, but I will
be very appreciated for your feedback.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden