From 4ec6037c22befec9e83c5ba16ec97501b837fa1c Mon Sep 17 00:00:00 2001 From: Andinus Date: Sat, 13 Jun 2020 21:05:53 +0530 Subject: Add option to hide 'Total' row --- ara.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/ara.pl b/ara.pl index f179044..31d3b47 100755 --- a/ara.pl +++ b/ara.pl @@ -27,7 +27,8 @@ foreach my $path (@INC) { or die "Unable to unveil: $!"; } -my ( $use_local_file, $get_latest, $state_notes, $rows_to_print, $no_delta ); +my ( $use_local_file, $get_latest, $state_notes, $rows_to_print, $no_delta, + $no_total ); GetOptions( "local" => \$use_local_file, @@ -35,6 +36,7 @@ GetOptions( "notes" => \$state_notes, "rows=i" => \$rows_to_print, "nodelta" => \$no_delta, + "nototal" => \$no_total, "help" => sub { HelpMessage() }, ) or die "Error in command line arguments"; @@ -44,7 +46,8 @@ sub HelpMessage { --latest Fetch latest data --notes Print State Notes --rows=i Number of rows to print (i is Integer) - --nodelta Don't print changes in values"; + --nodelta Don't print changes in values + --nototal Don't print 'Total' row"; print LOCALCOLOR CYAN " --help Print this help message "; @@ -162,6 +165,10 @@ $rows_to_print = scalar @$statewise foreach my $i ( 0 ... $rows_to_print - 1 ) { my $state = $statewise->[$i]{state}; + next + if $no_total + and $state eq "Total"; + $state = "India" if $state eq "Total"; -- cgit 1.4.1-2-gfad0