-
Notifications
You must be signed in to change notification settings - Fork 567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No subject provided #1082
Comments
From espie@schutzenberger.liafa.jussieu.frGetopt::Std does not stop processing options when it encounters The following patch makes it recognize --. Inline Patch--- Std.pm.orig Tue Jan 25 22:08:42 2000
+++ Std.pm Tue Jan 25 22:15:12 2000
@@ -60,6 +60,10 @@ sub getopt ($;$) {
while (@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
($first,$rest) = ($1,$2);
+ if (/^--$/) { # early exit if --
+ shift(@ARGV);
+ last;
+ }
if (index($argumentative,$first) >= 0) {
if ($rest ne '') {
shift(@ARGV);
@@ -111,6 +115,10 @@ sub getopts ($;$) {
@args = split( / */, $argumentative );
while(@ARGV && ($_ = $ARGV[0]) =~ /^-(.)(.*)/) {
($first,$rest) = ($1,$2);
+ if (/^--$/) { # early exit if --
+ shift(@ARGV);
+ last;
+ }
$pos = index($argumentative,$first);
if($pos >= 0) {
if(defined($args[$pos+1]) and ($args[$pos+1] eq ':')) { Perl Info
|
From [Unknown Contact. See original ticket]
"Real" programs don't use getopts. I don't see this an particularly onerous. It's not as though --tom |
From @TimToadyTom Christiansen writes: In which case it doesn't matter if people play with it. Almost everyone has to play with getopts at some point in their : I don't see this an particularly onerous. It's not as though I don't see much reason to reject the patch other than to be the mud Larry |
From [Unknown Contact. See original ticket]
I forgot the smiley! It was a joke.
I often find I don't use it because I can't, because the program next OPTION unless length; if (s/^b//) { if (s/^s//) { # historical practice makes -72 and -w 72 the same usage("unexpected option: -$_"); And here's the ppt awk front end for an awk-compatible call to a2p. while (@ARGV) { I sometimes even do something like this: @opt{ qw/d f/ } = (0, 0); But then again, in tcgrep, I'd risk going crazy without $optstring = "incCwsxvhe:f:l1EHurtpP:aqTF"; Hm... maybe I should FMTEYEWTK on arg processing. :-)
I corresponded with the author, who demonstrated some issues. I --tom |
Migrated from rt.perl.org#2035 (status was 'resolved')
Searchable as RT2035$
The text was updated successfully, but these errors were encountered: