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?



At 4:50 PM +0200 9/22/05, Jay Vaughan wrote:
>>This is a question more appropos to xcode-users, but I'll answer
>>anyway :).
>
>i thought it might've been, but then i thought maybe Carbon had ways to snarf the argv, also ..
>
>>Xcode's pseudo-terminal execution environment, both the
>>basic Run command and the gdb shell of the Debug command, runs the
>>command through something similar to this Terminal process:
>>$ cd /path/to/app/bundle
>>$ ./Application.app/Contents/MacOS/Application <the arguments you specified>
>>
>
>got it.. thanks for clearing that up.  suck for me, but okay. Info.plist/prefs it is ..
>
>>plenty that do in the Windows and X11 worlds). It's not
>>user-friendly. I can't imagine why you'd want to do this.
>
>i can't imagine why anyone would think -all- users are too stupid to want to use cmd line args.  i mean, c'mon .. i can do fprintf()'s to stderr, why can't i suck up my argv's .. its just .. ermm .. whatever.  lets not get political.
>
>>If you
>>want to supply configuration options, use preferences.
>
>looks like i have to.
>
>>Also, commandline arguments aren't reliable. Terminal users
>>won't get the ones you define, you can't do it directly via
>>Info.plist, and if you could, powerusers have a tendency to play
>>with commandline arguments when they see them and you're inviting
>>confusion at best that way.
>
>my users are not 'the general Apple public', they are testers and debug'ers and people otherwise using my tools to perform specific tasks.  if there were a way to make it easy to just keep using argv's, i'd prefer that; i don't want to have to special-case some Apple-only code in my project just to get this working.. but i will if, absolutely, i'm not allowed to think in argc/argv terms in this Carbon project.

If your users are tester and debug'ers (whatever that is) then tell them to launch your app from the command line with your custom arguments.  Doesn't that solve the problem right there?    Otherwise you seem to be trying to reproduce the "shortcut" file on Windows.  This is a file with your arguments in it, just like a text file (but far enough away to not be a text file ;-)...  Gwynne posted a solution to wrap your app with different calling shells (that pass the parameters to your executable)...  why won't this work for you?  Also what about a shell script that users double click that execute your app through the terminal?

alex


[big snip]
 _______________________________________________
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>)
 >Re: How to pass cmd line arguments to my carbon app? (From: Chris Espinosa <email@hidden>)
 >Re: How to pass cmd line arguments to my carbon app? (From: Jay Vaughan <email@hidden>)
 >Re: How to pass cmd line arguments to my carbon app? (From: Eric Schlegel <email@hidden>)
 >Re: How to pass cmd line arguments to my carbon app? (From: Jay Vaughan <email@hidden>)
 >Re: How to pass cmd line arguments to my carbon app? (From: Gwynne <email@hidden>)
 >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.