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?




I think it makes perfect sense. The Mac has never targeted as its primary
market people who would pass command line arguments to applications.
Furthermore, all your ranting about standard C behavior aside, the preferred
language for Mac development in the early days was Pascal, not C.

ermm .. i'm not ranting, i'm complaining that main(int argc, char *argv[]) is useless on mac, whereas quite useful, still, elsewhere.. and it just looks like a big "Apple says fark you" to anyone who still needs to depend on such mechanisms for their **portable** **non-Apple-exclusive** apps which are supposed to be supported on OSX, among many other target platforms ..


i care not one iota that Pascal was once the fetish of choice for Apple weenies. i've written far too many millions of lines of Pascal code in my time to care, any more, for its historical relevance to Carbon apps still relying on good-ol' C mechanisms for app control.

i only care that i'm using Carbon to do what i need to do, it works just fine for all things normally, but now i have to write special code to get done what i should be able to just do, somehow, if only the [exclusive-to-mac] way of thinking wasn't futzing with standard C mechanisms for communicating to your apps main() thread from the execution environment ..

and the thing is, apps *do* have an argv[] space to deal with, or else whats all this -psn_* monkeybusiness all about, eh .. maybe there's some way for me to tail my args onto the end of that -psn_ through some service i'm not aware of ..

indeed, all i want to know is if there is a 'secret' or (i can't find it in the docs) kind of Info.plist entry that can be used to construct the argv[] string.

like:

	<key>CFBundleExecutableArgs</key>
        <string>-these -args -rock -ass</string>

this would be ideal. its not possible, so i'll just have to use *more* Carbon to solve the problem, and write yet more redundant code to play along with Apple. i'm used to that.

Indeed, the Mac OS is not Windows, which is okay with most of us. ;-)  My
only response to comments about what you can do on other platforms but not
on the Mac is that the last time Microsoft had a "switchers" page it
featured an actress Microsoft had hired and a testimonial written by a
professional ad copywriter. ;-)


like, whatever, yo, it just works and goes bling when i need bling.

 > can i be sure that there are -no- ways to get argc/argv from a the
 > bundle .plist?
I just have no idea about this one.

alright, thats what i need to know. you have no idea. cool. i'll have to Apple'ize my arg parsing with a less-than-quick kow-tow to the Info.plist ..


and hey, its only sweat.

--

;

Jay Vaughan

_______________________________________________
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: Laurence Harris <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.