473,432 Members | 1,420 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,432 software developers and data experts.

getopt under windows

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
Nov 7 '07 #1
14 39114
In article <5p************@mid.uni-berlin.de>,
Markus Mayer <co***********************@defx.dewrote:
>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)

Nov 7 '07 #2
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
Nov 7 '07 #3
Markus Mayer <co***********************@defx.dewrites:
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.
Nov 7 '07 #4
Am 07.11.2007 14:12 postulierte Kenny McCormack folgendes:
In article <5p************@mid.uni-berlin.de>,
Markus Mayer <co***********************@defx.dewrote:
>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
Nov 7 '07 #5
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
Nov 7 '07 #6
Am 07.11.2007 13:21 postulierte Friedrich Dominicus folgendes:
Markus Mayer <co***********************@defx.dewrites:
>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
Nov 7 '07 #7
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
Nov 7 '07 #8
On Nov 7, 8:01 am, Markus Mayer <contact.me.via.my.webs...@defx.de>
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

Nov 7 '07 #9
Markus Mayer <co***********************@defx.dewrites:
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
Nov 7 '07 #10
Am 07.11.2007 16:15 postulierte Nemanja Trifunovic folgendes:
On Nov 7, 8:01 am, Markus Mayer <contact.me.via.my.webs...@defx.de>
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
Damn, I always forget about Boost. I'll have a look at that, too.
Thanks!

Markus
Nov 7 '07 #11
On Nov 7, 5:01 am, Markus Mayer <contact.me.via.my.webs...@defx.de>
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.)
There are getopt() variants available as source code all over the net.

My favorite is my_getopt:
http://www.geocities.com/bsittler/

Next time, when you are looking for source code, do a web search.

Asking news:comp.lang.c to do it for you is annoyingly lazy.

Nov 7 '07 #12

"Markus Mayer" <co***********************@defx.dewrote in message
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.)
Ypu seem to have found what you are looking for.
There's an options parser on my website that does error-checking for you.
However it works in rather a different way to getopt(). I'd like to think
better.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm

Nov 7 '07 #13
On Nov 7, 8:01 am, Markus Mayer <contact.me.via.my.webs...@defx.de>
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.)

See XGetOpt: http://www.codeproject.com/cpp/xgetopt.asp

Nov 8 '07 #14
Am 08.11.2007 20:44 postulierte Nemanja Trifunovic folgendes:
On Nov 7, 8:01 am, Markus Mayer <contact.me.via.my.webs...@defx.de>
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.)


See XGetOpt: http://www.codeproject.com/cpp/xgetopt.asp
Yeah, I found that before but I forgot to mention that the solution I
search(ed) for has to be ANSI C compatible.

Thanks anyway!
Markus
Nov 9 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: David Bear | last post by:
I'm stumped. Trying to follow the docs and .. failure. here's the args >>> args '-Middwb@mainex1.asu.edu -AKHAAM@prlinux+898 -CA --D2003-08-20-09:28:13.417 -Ff -Hprlinux...
0
by: Bruce Davis | last post by:
I'm having a problem on windows (both 2000 and XP) with a multi-threaded tkinter gui application. The problem appears to be a deadlock condition when a child thread pops up a Pmw dialog window in...
3
by: Dominik Kaspar | last post by:
I tried to use getopt and copied the example from: http://www.python.org/doc/current/lib/module-getopt.html but nothing is working... getopt.GetoptError doesn't seem to exist and when i run the...
3
by: Don Low | last post by:
Hi, I'm going over a script that demonstrates the getopt function. I include the script here: #! /usr/bin/python import sys, getopt, string
14
by: José de Paula | last post by:
Is getopt() and its companions, commonly found in GNU libc and other Unices libc, part of the C standard? Another doubt: I have a switch inside a while loop; is there a way to break out of the...
18
by: k_over_hbarc | last post by:
What is the correct format of getopt() and how does it work? I looked at the man page; it doesn't really clarify things. What's a program that uses it, maybe I could figure it out from that. ...
4
by: pinkfloydhomer | last post by:
I want to be able to do something like: myscript.py * -o outputfile and then have the shell expand the * as usual, perhaps to hundreds of filenames. But as far as I can see, getopt can only...
1
by: Daniel Mark | last post by:
Hello all: I am using getopt package in Python and found a problem that I can not figure out an easy to do . // Correct input D:\>python AddArrowOnImage.py --imageDir=c:/ // Incorrect...
1
by: ose | last post by:
How to convert the "while" stetement in the following code from Linux to run on Windows? while((c= getopt(argc, argv, "i:o:x:c:lkh")) != -1) { switch(c) { case 'g': ... case 'h'
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.