> Well, you could, but it may be easier to copy the structure from a
different program, e.g. programs/ping/ping_main.c.
I considered this choice at first, and I read some of the command line parsing patterns from other files. But robocopy has covered almost all kinds of dos-style command line flags:
- flag with no argument, eg: /x
- colon separated argument, eg: /x:10
- space separated argument list, eg: /x arg1 arg2
The three types are all needed by Waves Central or Scoop.
I didn't find a program which has to deal with such complex parsing, and the complexity to write a structure to parse all three kinds of flags seems to be similar to implementing a dos-style `getopt`. Besides, `getopt` is something standard, and I can refer to lots of implementations. If a dos-style `getopt` is done, maybe it could help new programs or improve existing programs.
I think I could do my test of `getopt` somewhere else, and copy tested code to the wine project. `getopt` is not hard/complex, and there are standard implementations which are proved to be right.
Unittest of such a little program may be too cumbersome. ;)
Weiwen