Commit 20e806cb authored by Peter Pentchev's avatar Peter Pentchev

p6: declare type constraints on some more variables.

parent 453e0cf0
......@@ -10,7 +10,7 @@ use strict;
use Getopt::Tiny;
use Terminal::ANSIColor;
my $use_color;
my Bool $use_color;
sub version()
{
......@@ -181,7 +181,7 @@ sub convert(Str $iface, UInt:D $period)
{
try my $f = open :r, '/proc/net/dev', :chomp(False), :enc('latin1');
die "Could not open the interface info pseudo-file: $!" if $!;
my $contents = '';
my Str $contents = '';
for $f.lines -> $line {
# Ah, the joys of reading from pseudo-files...
last if $line eq '';
......@@ -214,8 +214,8 @@ sub acolor(Str:D $name)
}
{
my %flags;
my $opts = Getopt::Tiny.new;
my Bool %flags;
my Getopt::Tiny $opts .= new;
$opts.bool('h', Nil, -> $v { %flags<h> = $v });
$opts.bool('V', Nil, -> $v { %flags<V> = $v });
......@@ -274,7 +274,7 @@ sub acolor(Str:D $name)
exit 0;
}
$total = InterfaceStats.new(:name('total'));
$total .= new(:name('total'));
convert $iface, 1;
sleep 1;
loop {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment