From d7f74df6a6864826162af01fb9687fe7c54050a8 Mon Sep 17 00:00:00 2001 From: Andinus Date: Sun, 14 Jun 2020 21:56:57 +0530 Subject: Move HelpMessage sub near GetOptions --- ara.pl | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'ara.pl') diff --git a/ara.pl b/ara.pl index f232d32..7927f37 100755 --- a/ara.pl +++ b/ara.pl @@ -31,6 +31,23 @@ foreach my $path (@INC) { my ( $use_local_file, $get_latest, $state_notes, $rows_to_print, $no_delta, $no_total, @to_hide, %hide, @to_show, %show, $no_words ); +sub HelpMessage { + print LOCALCOLOR GREEN "Options: + --local Use local data + --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 + --nototal Don't print 'Total' row + --nowords Don't format numbers with words + --hide Hide states, columns from table (space seperated) + --show Show only these states (space seperated)"; + print LOCALCOLOR CYAN " + --help Print this help message +"; + exit; +} + GetOptions( "local" => \$use_local_file, "latest" => \$get_latest, @@ -77,23 +94,6 @@ warn LOCALCOLOR YELLOW "Cannot hide state column" if exists $hide{state}; warn LOCALCOLOR YELLOW "Cannot hide notes column" if exists $hide{notes} and $state_notes; -sub HelpMessage { - print LOCALCOLOR GREEN "Options: - --local Use local data - --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 - --nototal Don't print 'Total' row - --nowords Don't format numbers with words - --hide Hide states, columns from table (space seperated) - --show Show only these states (space seperated)"; - print LOCALCOLOR CYAN " - --help Print this help message -"; - exit; -} - my $cache_dir = $ENV{XDG_CACHE_HOME} || "$ENV{HOME}/.cache"; # %unveil contains list of paths to unveil with their permissions. @@ -226,7 +226,7 @@ foreach my $i ( 0 ... scalar @$statewise - 1 ) { next unless exists $show{lc $state} or ( length $state > 16 - and exists $show{lc $statewise->[$i]{statecode}}) + and exists $show{lc $statewise->[$i]{statecode}}); } else { next if exists $hide{lc $state} -- cgit 1.4.1-2-gfad0