Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to pass cmd line arguments to my carbon app?



on 9/22/05 10:31 AM, Jay Vaughan at <email@hidden> wrote:
> i want to maintain compatability with my args list, which are used on
> other platforms, for compatabilities sake, to make it easy to support
> my already-argc/argv-savvy users, and not have to do things through
> some kinda plist editor unless i very much have to .. which its now
> clear i must .. but the reason i'm so into this arg thing is simply,
> i want, simply, to be able to say "add these args to your app:
> -dontcrash -getlost -havefun", and have it be a 'standard list of
> args' that either an OSX or Unix user can grok, over the phone, and
> run the app.

If you're users are "argc/argv-savvy" then they can run terminal and feel
100% right at home. I don't see the problem. And I don't see how you adding
anything to your Info.plist file is going to be doing anything for those
users anyway.

> and guess what?  thanks to the responses on this list, i've decided
> simply to just add a new key to my Info.plist file, called
> "CFBundleExecutableArgs", which is Apple-friendly, and will still be
> 'compatible' with my args parser without too much fuss, or stress.
> and i can just bend the minds of the OSX users, tell them to look for
> that key, and add the args they need.  which will still be compatible
> with the Unix way of doing things.

Actually, I'm pretty confident that your "argc/argv-savvy" users are just as
comfortable (if not more so) with having a preferences window where they can
interact with standard controls (menus, check boxes, buttons, etc.) as they
are with command lines. That being said, why try to force all the
non-"argc/argv-savvy" users into the "old school" way of doing things?

Plus if the option is in a preference pane your users are much more likely
to figure it out for themselves rather than having to get it "over the
phone".

> it'd be 'nice', if somehow, there was already an accomodation for
> this in the Info.plist spec, to have a 'good old command line
> representation' available to Carbon apps/tools.  thats all i'm trying
> to confirm/deny: does such a thing exist, if not, i'll have to add it.

What does your application do if the user does launch your app from the
terminal and supply arguments? Do your override his? Or his yours?

Plus application bundle files are usually all read-only. Your
"argc/argv-savvy" users probably know how to "chmod" but even that won't
work on read-only volumes (servers or CD/DVD ROM's, etc.).

> psychological assessments of character aside, rants and raves about
> apple-itis aside, this just seems like an 'obvious' thing for a
> .plist .. after all, doesn't Apple want to support app ports from
> other environments as much as possible?

More so than they want to support our apps. But I hope you've noticed that
all those environments (poorly) copied their GUI's from us?

I think the best solution if you absolutely insist on doing things this way
would be for you to write a clickable script that launches your application
and passes it the parameters you desire. If you want to change the
parameters then you can edit the script. This is something that your
"argc/argv-savvy" already know how to do. And if the script is on a
read-only volume the user could always copy the script to a location where
they could edit it.

> and if i don't talk about  it, maybe nobody will get the point ..

I totally "get your point". I just don't agree with it. I'm not "just a Mac
(GUI) bigot". I got my first computer ten years before the first GUI and
probably still spend more time in terminal than I do in the Finder. I very
much am one of your "argc/argv-savvy" users. I'm completely comfortable at
the command line. But my primary objective there is to help developers write
applications that don't require their users to know such arcane skills. ;-)
-- 
Enjoy,
George Warner,
Schizophrenic Optimization Scientist
Apple Developer Technical Support (DTS)


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: How to pass cmd line arguments to my carbon app? (From: Jay Vaughan <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.