about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndinus <andinus@nand.sh>2020-06-14 21:56:57 +0530
committerAndinus <andinus@nand.sh>2020-06-15 02:42:03 +0530
commitd7f74df6a6864826162af01fb9687fe7c54050a8 (patch)
tree42bff099ceb8f4e4e6f542b7de0cd432f1a946ad
parent2d289f14eddb5f4fd1eddd88ed84487aef7c97e1 (diff)
downloadara-d7f74df6a6864826162af01fb9687fe7c54050a8.tar.gz
Move HelpMessage sub near GetOptions
-rwxr-xr-xara.pl36
1 files changed, 18 insertions, 18 deletions
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}