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: Example Standard XCode projects handlinig command line parameters




On Mar 17, 2006, at 21:26 , Keith Hutchison wrote:

I'm writing a small utility to accept parameters like
pgcl -h 192.168.27.97 -p 5432 -u someName -p somePassword -d
someDatabase -s someSQL > someDelimitedResult
to connect to remote postgresql database and run some sql.

I have a command line project working, and I'm currently hardcoding
the variables.

Anyone know of a c and/or a c++ example program/project showing how to
handle command line arguments within an Xcode project?

It's not clear (to me) what you want. Do you want to feed command- line arguments to a command-line tool while you are testing it within Xcode; or do you want to know how to access command-line arguments from within a C/C++ program?


For the former, search the Xcode documentation, or the list archives. If it's the latter, almost any tool, available from the Darwin source site or, say, the FreeBSD or Linux sites, will provide examples. As a start, check the man page for 'getopt()' ("man 3 getopt").

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
When LuteFisk is outlawed,
Only outlaws will have LuteFisk
--------



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

This email sent to email@hidden
References: 
 >Example Standard XCode projects handlinig command line parameters (From: "Keith Hutchison" <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.