3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-11-29 15:29:32 +01:00

Plugins/Wttr: improve wttr usage message

This commit is contained in:
Pragmatic Software 2020-05-20 10:34:05 -07:00
parent 7e38ee6793
commit 7a0de62612

View File

@ -49,7 +49,7 @@ sub cmd_wttr {
"heatindex", "heatindex",
"cloudcover", "cloudcover",
"wind", "wind",
"sunrise|sunset", "sun",
"moon", "moon",
"chances", "chances",
"sunhours", "sunhours",
@ -62,7 +62,7 @@ sub cmd_wttr {
"all", "all",
); );
my $usage = "Usage: wttr [-u <user account>] [location] [" . join(' ', map { "-$_" } @wttr_options) . "]"; my $usage = "Usage: wttr (<location> | -u <user account>) [" . join(' ', map { "-$_" } @wttr_options) . "]; to have me remember your location, use `my location <location>`.";
my $getopt_error; my $getopt_error;
local $SIG{__WARN__} = sub { local $SIG{__WARN__} = sub {
$getopt_error = shift; $getopt_error = shift;
@ -303,7 +303,7 @@ sub get_wttr {
$result .= "Moon: phase: $a->{'moon_phase'}, illumination: $a->{'moon_illumination'}%, rise: $a->{'moonrise'}, set: $a->{'moonset'}; "; $result .= "Moon: phase: $a->{'moon_phase'}, illumination: $a->{'moon_illumination'}%, rise: $a->{'moonrise'}, set: $a->{'moonset'}; ";
} }
when ('sunrise') { when ('sun') {
my $a = $w->{'astronomy'}->[0]; my $a = $w->{'astronomy'}->[0];
$result .= "Sun: rise: $a->{'sunrise'}, set: $a->{'sunset'}; "; $result .= "Sun: rise: $a->{'sunrise'}, set: $a->{'sunset'}; ";
} }