]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiHelp.pm
www_stream: add trailing slash for help and color links
[public-inbox.git] / lib / PublicInbox / LeiHelp.pm
index 43414ab4a9874b1a4b901212cb64183316693274..be31c2a86247d32c8e9ba2624d82544c6174dea7 100644 (file)
@@ -7,7 +7,7 @@ use strict;
 use v5.10.1;
 use Text::Wrap qw(wrap);
 
-my %NOHELP = map { $_ => 1 } qw(mua-cmd mfolder);
+my %NOHELP = map { $_ => 1 } qw(mfolder);
 
 sub call {
        my ($self, $errmsg, $CMD, $OPTDESC) = @_;
@@ -20,7 +20,7 @@ sub call {
        my @opt_desc;
        my $lpad = 2;
        for my $sw (grep { !ref } @info) { # ("prio=s", "z", $GLP_PASS)
-               my $desc = $OPTDESC->{"$cmd\t$sw"} // $OPTDESC->{$sw} // next;
+               my $desc = $OPTDESC->{"$sw\t$cmd"} // $OPTDESC->{$sw} // next;
                my $arg_vals = '';
                ($arg_vals, $desc) = @$desc if ref($desc) eq 'ARRAY';
 
@@ -40,7 +40,7 @@ sub call {
                        @vals = (' [', undef, ']');
                } elsif ($x =~ s/=.+//) { # required arg: $x = "type=s"
                        @vals = (' ', undef);
-               } # else: no args $x = 'thread|t'
+               } # else: no args $x = 'threads|t'
 
                # we support underscore options from public-inbox-* commands;
                # but they've never been documented and will likely go away.
@@ -48,7 +48,7 @@ sub call {
                for (grep { !/_/ && !$NOHELP{$_} } split(/\|/, $x)) {
                        length($_) > 1 ? push(@l, "--$_") : push(@s, "-$_");
                }
-               if (!scalar(@vals)) { # no args 'thread|t'
+               if (!scalar(@vals)) { # no args 'threads|t'
                } elsif ($arg_vals =~ s/\A([A-Z_]+)\b//) { # "NAME"
                        $vals[1] = $1;
                } else {