3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-10-03 01:48:38 +02:00

Plugins: fix getopt configuration

This commit is contained in:
Pragmatic Software 2020-02-10 13:35:46 -08:00
parent cb0b39a0e5
commit 99a3266106
4 changed files with 8 additions and 4 deletions

View File

@ -14,7 +14,6 @@ use warnings; use strict;
use feature 'unicode_strings';
use Getopt::Long qw(GetOptionsFromString);
Getopt::Long::Configure("bundling");
sub initialize {
my ($self, %conf) = @_;
@ -36,6 +35,8 @@ sub datecmd {
chomp $getopt_error;
};
Getopt::Long::Configure("bundling");
my ($user_override, $show_usage);
my ($ret, $args) = GetOptionsFromString($arguments,
'u=s' => \$user_override,

View File

@ -15,7 +15,6 @@ use DBI;
use Time::Duration qw/concise duration/;
use Time::HiRes qw/gettimeofday/;
use Getopt::Long qw(GetOptionsFromString);
Getopt::Long::Configure ("bundling");
sub initialize {
my ($self, %conf) = @_;
@ -189,6 +188,8 @@ sub remindme {
chomp $getopt_error;
};
Getopt::Long::Configure ("bundling");
$arguments =~ s/(?<!\\)'/\\'/g;
my ($ret, $args) = GetOptionsFromString($arguments,
'r:i' => \$repeat,

View File

@ -16,7 +16,6 @@ use feature 'unicode_strings';
use PBot::Utils::LWPUserAgentCached;
use XML::LibXML;
use Getopt::Long qw(GetOptionsFromString);
Getopt::Long::Configure("bundling");
sub initialize {
my ($self, %conf) = @_;
@ -37,6 +36,8 @@ sub weathercmd {
chomp $getopt_error;
};
Getopt::Long::Configure("bundling");
my ($user_override, $show_usage);
my ($ret, $args) = GetOptionsFromString($arguments,
'u=s' => \$user_override,

View File

@ -21,7 +21,6 @@ use PBot::Utils::LWPUserAgentCached;
use JSON;
use URI::Escape qw/uri_escape_utf8/;
use Getopt::Long qw(GetOptionsFromString);
Getopt::Long::Configure("bundling_override", "ignorecase_always");
sub initialize {
my ($self, %conf) = @_;
@ -63,6 +62,8 @@ sub wttrcmd {
chomp $getopt_error;
};
Getopt::Long::Configure("bundling_override", "ignorecase_always");
my %options;
my ($ret, $args) = GetOptionsFromString($arguments,
\%options,