3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-26 22:09:26 +01:00

MessageHistory: override sort method to seen if -l is specified without -sort

This commit is contained in:
Pragmatic Software 2020-05-18 10:57:23 -07:00
parent b3a5b57f71
commit f293366ad0

View File

@ -67,7 +67,7 @@ sub cmd_list_also_known_as {
Getopt::Long::Configure("bundling_override");
my $sort_method = 'nick';
my $sort_method = undef;
my ($show_hostmasks, $show_gecos, $show_nickserv, $show_id, $show_relationship, $show_weak, $show_last_seen, $dont_use_aliases_table);
my @opt_args = $self->{pbot}->{interpreter}->split_line($context->{arguments}, strip_quotes => 1);
GetOptionsFromArray(
@ -87,6 +87,9 @@ sub cmd_list_also_known_as {
return "Too many arguments -- $usage" if @opt_args > 1;
return "Missing argument -- $usage" if @opt_args != 1;
$sort_method = 'seen' if $show_last_seen and not defined $sort_method;
$sort_method = 'nick' if not defined $sort_method;
my %sort = (
'id' => sub {
if ($_[1] eq '+') {