This is the mail archive of the
mailing list for the Cygwin project.
Re: Shouldn't getopt_long() return : here?
- From: Charles Wilson <cygwin at cwilson dot fastmail dot fm>
- To: cygwin at cygwin dot com
- Date: Sun, 24 Apr 2005 16:09:54 -0400
- Subject: Re: Shouldn't getopt_long() return : here?
- References: <firstname.lastname@example.org>
const char *short_options = "";
This is your problem. You need to have ':' as the first character in
short_options, if you want the behavior you describe. (Also, if you
plan to handle errors -- including printing the error message yourself
-- you need to set the global variable opterr to 0)
So, you need
const char *short_options = ":";
/* opterr = 0; */ /* maybe */
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html