X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/misc/blobdiff_plain/e063712b9d335fffae64f418af5abd0b51a512d1..4254eec2d9c48dfe5bb40f11fdb95f6510c20f47:/MdwOpt.pm diff --git a/MdwOpt.pm b/MdwOpt.pm index b268c15..6ee8112 100644 --- a/MdwOpt.pm +++ b/MdwOpt.pm @@ -39,7 +39,7 @@ require Exporter; # routine, although the interface is rather different, since it # takes advantage of some of Perl's object-oriented features. # -# +# # How options parsing appears to users # # A command line consists of a number of `words' (which may @@ -166,7 +166,7 @@ require Exporter; # permute Force permuting of the argument list # inorder Read options in order # posix Force use of POSIX option semantics -# quiet Don't report errors when they happen +# quiet Don't report errors when they happen sub new { @@ -382,7 +382,7 @@ sub read ($opt,$self->{this})=(substr($self->{this},0,1),substr($self->{this},1)); $prefix=($self->{flags}{_neg} ? '+' : '-'); - + if ($self->{short} =~ /\Q$opt/ && (!$self->{flags}{_neg} || substr($',0,1) eq '+')) { @@ -401,7 +401,7 @@ sub read return ('?',$self->err("option `$prefix$opt' requires an argument")) unless defined($arg); } - } + } $opt.='+' if $self->{flags}{_neg}; return ($opt,$arg);