]> git.99rst.org Git - irssi-scripts.irssi.org.git/commitdiff
Include defaults in ctrlact list output
authormartin f. krafft <redacted>
Fri, 17 Sep 2021 21:30:59 +0000 (23:30 +0200)
committermartin f. krafft <redacted>
Fri, 17 Sep 2021 23:45:06 +0000 (01:45 +0200)
Signed-off-by: martin f. krafft <redacted>
scripts/ctrlact.pl

index 1a70a0bea53129fd398d64f94844a137aa53edc0..5c49ab8d3e7ad857d7540bf0e32c780c97b9f0a2 100644 (file)
@@ -331,12 +331,14 @@ sub walk_match_array {
 }
 
 sub get_mappings_table {
-       my ($arr) = @_;
+       my ($arr, $fallback) = @_;
        my @ret = ();
        while (my ($i, $elem) = each @{$arr}) {
                push @ret, sprintf("%7d: %-16s %-32s %-9s %-5s (%s)",
                        $i, @{$elem});
        }
+       push @ret, sprintf("%7s: %-16s %-32s %-9s %-5s (%s)",
+               'last', '*', '*', from_data_level($fallback), '∞', 'default');
        return join("\n", @ret);
 }
 
@@ -889,9 +891,9 @@ sub cmd_sleep {
 }
 
 sub cmd_list {
-       info("WINDOW MAPPINGS\n" . get_mappings_table(\@window_thresholds));
-       info("CHANNEL MAPPINGS\n" . get_mappings_table(\@channel_thresholds));
-       info("QUERY MAPPINGS\n" . get_mappings_table(\@query_thresholds));
+       info("WINDOW MAPPINGS\n" . get_mappings_table(\@window_thresholds, $fallback_window_threshold));
+       info("CHANNEL MAPPINGS\n" . get_mappings_table(\@channel_thresholds, $fallback_channel_threshold));
+       info("QUERY MAPPINGS\n" . get_mappings_table(\@query_thresholds, $fallback_query_threshold));
 }
 
 sub cmd_query {
git clone https://git.99rst.org/PROJECT