Skip to content

Commit

Permalink
pass_gen.pl: Removed Term::ReadKey as a required module to print the …
Browse files Browse the repository at this point in the history
…usage screen. If found it will be used, but the script does not carp if the module is not found. #2251
  • Loading branch information
jfoug committed Aug 31, 2016
1 parent 48d76c0 commit 28713b6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions run/pass_gen.pl
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,14 @@
}

sub pretty_print_hash_names {
require Term::ReadKey;
import Term::ReadKey qw(GetTerminalSize);
my ($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
my ($wchar, $hchar, $wpixels, $hpixels);
$wchar = 80; # default IF Term::ReadKey lib not found.
if (eval "require Term::ReadKey") {
# note, if Term::ReadKey is not installed, the script
# does not abort, but uses 80 columns for width of terminal.
import Term::ReadKey qw(GetTerminalSize);
($wchar, $hchar, $wpixels, $hpixels) = GetTerminalSize();
}
#if ($wchar > 120) {$wchar = 121;}
--$wchar;
my $s; my $s2; my $i;
Expand Down

0 comments on commit 28713b6

Please sign in to comment.