Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > getopt under windows

Reply
Thread Tools

getopt under windows

 
 
Friedrich Dominicus
Guest
Posts: n/a
 
      11-07-2007
Markus Mayer <(E-Mail Removed)> writes:

> Hi.
>
> Any chances that there is a similar thing to *nix's getopt() under
> windows? (It doesn't actually have to be too nifty, the requirement is
> just that it is stable.)

The glib contains something similiar visit pages below
http://www.gtk.org/

and libapr has something in that area also:
http://apr.apache.org/docs/apr/1.2/g...r__getopt.html

Regards
Friedrich

--
Please remove just-for-news- to reply via e-mail.
 
Reply With Quote
 
 
 
 
Markus Mayer
Guest
Posts: n/a
 
      11-07-2007
Hi.

Any chances that there is a similar thing to *nix's getopt() under
windows? (It doesn't actually have to be too nifty, the requirement is
just that it is stable.)

Regards,
Markus
 
Reply With Quote
 
 
 
 
Kenny McCormack
Guest
Posts: n/a
 
      11-07-2007
In article <(E-Mail Removed)-berlin.de>,
Markus Mayer <(E-Mail Removed)> wrote:
>Hi.
>
>Any chances that there is a similar thing to *nix's getopt() under
>windows? (It doesn't actually have to be too nifty, the requirement is
>just that it is stable.)


The obvious thing is: Google is your friend.

/OT - I used getopts() in Windows all the time - under Cygwin - /OT

(I don't know if there is a "native" API for it - Google [or MSDN] will
tell you)

 
Reply With Quote
 
jacob navia
Guest
Posts: n/a
 
      11-07-2007
Markus Mayer wrote:
> Hi.
>
> Any chances that there is a similar thing to *nix's getopt() under
> windows? (It doesn't actually have to be too nifty, the requirement is
> just that it is stable.)
>
> Regards,
> Markus


The lcc-win32 compiler has getopt() as part of its standard
library. If interested I can mail you the source.

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32
 
Reply With Quote
 
Markus Mayer
Guest
Posts: n/a
 
      11-07-2007
Am 07.11.2007 14:12 postulierte Kenny McCormack folgendes:
> In article <(E-Mail Removed)-berlin.de>,
> Markus Mayer <(E-Mail Removed)> wrote:
>> Hi.
>>
>> Any chances that there is a similar thing to *nix's getopt() under
>> windows? (It doesn't actually have to be too nifty, the requirement is
>> just that it is stable.)

>
> The obvious thing is: Google is your friend.


No it's not. Google hates me.

Regards,
Markus
 
Reply With Quote
 
Markus Mayer
Guest
Posts: n/a
 
      11-07-2007
Am 07.11.2007 14:19 postulierte jacob navia folgendes:
> Markus Mayer wrote:
>> Hi.
>>
>> Any chances that there is a similar thing to *nix's getopt() under
>> windows? (It doesn't actually have to be too nifty, the requirement is
>> just that it is stable.)
>>
>> Regards,
>> Markus

>
> The lcc-win32 compiler has getopt() as part of its standard
> library. If interested I can mail you the source.
>


That would be nice. For my mail address, strip everything before the "@"
sign from the address and replace it with "sunside".

Thanks in advance!
Markus
 
Reply With Quote
 
Markus Mayer
Guest
Posts: n/a
 
      11-07-2007
Am 07.11.2007 13:21 postulierte Friedrich Dominicus folgendes:
> Markus Mayer <(E-Mail Removed)> writes:
>
>> Hi.
>>
>> Any chances that there is a similar thing to *nix's getopt() under
>> windows? (It doesn't actually have to be too nifty, the requirement is
>> just that it is stable.)

> The glib contains something similiar visit pages below
> http://www.gtk.org/
>
> and libapr has something in that area also:
> http://apr.apache.org/docs/apr/1.2/g...r__getopt.html


Thanks, I'll have a look!

Markus
 
Reply With Quote
 
Markus Mayer
Guest
Posts: n/a
 
      11-07-2007
Am 07.11.2007 14:47 postulierte Markus Mayer folgendes:
> Am 07.11.2007 14:19 postulierte jacob navia folgendes:
>> Markus Mayer wrote:
>>> Hi.
>>>
>>> Any chances that there is a similar thing to *nix's getopt() under
>>> windows? (It doesn't actually have to be too nifty, the requirement is
>>> just that it is stable.)
>>>
>>> Regards,
>>> Markus

>> The lcc-win32 compiler has getopt() as part of its standard
>> library. If interested I can mail you the source.
>>


NetBSD/OpenBSD getopt(); getopt.h signature:
/* $OpenBSD: getopt.h,v 1.1 2002/12/03 20:24:29 millert Exp $ */
/* $NetBSD: getopt.h,v 1.4 2000/07/07 10:43:54 ad Exp $ */

I had to fine tune some things to make it work with VC++, but it now
works like a charm.

Thanks alot!
Markus
 
Reply With Quote
 
Nemanja Trifunovic
Guest
Posts: n/a
 
      11-07-2007
On Nov 7, 8:01 am, Markus Mayer <(E-Mail Removed)>
wrote:
> Hi.
>
> Any chances that there is a similar thing to *nix's getopt() under
> windows? (It doesn't actually have to be too nifty, the requirement is
> just that it is stable.)
>


Take a look at XGetopt: http://www.codeproject.com/cpp/xgetopt.asp

Or even better, if you are using C++, there is Boost.Program_options
library which is portable: http://www.boost.org/doc/html/program_options.html

 
Reply With Quote
 
Ben Pfaff
Guest
Posts: n/a
 
      11-07-2007
Markus Mayer <(E-Mail Removed)> writes:

> Any chances that there is a similar thing to *nix's getopt() under
> windows? (It doesn't actually have to be too nifty, the requirement is
> just that it is stable.)


getopt is pretty simple. Why not just implement it yourself?
--
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it."
--Brian Kernighan
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A router running under WinXP runs under Windows Vista too? Peter Wagner Wireless Networking 12 02-04-2008 11:02 PM
getopt and getopt_long for Windows? Angel Tsankov C++ 1 03-03-2006 02:02 PM
Having problems parsing command line options using Getopt::Long on windows mothra Perl Misc 3 12-02-2004 05:41 PM
Java application developped under Linux running ridiculously slow under Windows hshdude Java 12 11-04-2004 05:49 PM
Problem with Getopt Arvind Kumar Perl 1 11-03-2003 06:50 PM



Advertisments