I'm not sure what happens actually. If I run the Getopt functions manually in Hilfe, the -M seems to be parsed correctly regardless of whether there is a space there or not. So I assume it's Getopt.get_args() that does something funky. However, I don't understand the use of get_args in the master, it doesn't work at all if I try the same statement in Hilfe:
Pike v7.4 release 17 running Hilfe v3.5 (Incremental Pike Frontend)
Getopt.find_all_options(({"pike","-M","hej","grunk","hopp"}),({({"m",Getopt.HAS_ARG,({"-M","--mp"}),0,0})}),1);
(1) Result: ({ /* 1 element */ ({ /* 2 elements */ "m", "hej" }) })
Getopt.find_all_options(({"pike","-Mhej","grunk","hopp"}),({({"m",Getopt.HAS_ARG,({"-M","--mp"}),0,0})}),1);
(2) Result: ({ /* 1 element */ ({ /* 2 elements */ "m", "hej" }) })
Getopt.get_args(({"pike","-M","hej","grunk","hopp"}),1);
Unknown option -M. pelix:~%
/ Marcus Comstedt (ACROSS) (Hail Ilpalazzo!)
Previous text:
2003-03-30 15:13: Subject: args
So if I have a single -M, it eats two more arguments before it starts to parse again?
Note the difference:
orchid% pike ~/pike/lib/modules -D FOO=17 -e 'werror("%O\n",FOO)'; echo Pike: Couldn't find script to execute ("/home/mirar/pike/lib/modules")
I have a clear memory of the possibility of doing "-M ~/...", but I might be wrong.
/ Mirar