summaryrefslogtreecommitdiff
path: root/lib/Vyatta/Misc.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Vyatta/Misc.pm')
-rwxr-xr-xlib/Vyatta/Misc.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/Vyatta/Misc.pm b/lib/Vyatta/Misc.pm
index 6579da7..850cb2b 100755
--- a/lib/Vyatta/Misc.pm
+++ b/lib/Vyatta/Misc.pm
@@ -21,14 +21,17 @@
package Vyatta::Misc;
use strict;
+use Vyatta::ioctl;
require Exporter;
+
our @ISA = qw(Exporter);
our @EXPORT = qw(getInterfaces getIP getNetAddIP get_sysfs_value
is_address_enabled is_dhcp_enabled get_ipaddr_intf_hash
isIpAddress is_ip_v4_or_v6 interface_description
is_local_address is_primary_address get_ipnet_intf_hash
- isValidPortNumber);
+ isValidPortNumber get_terminal_size get_terminal_height
+ get_terminal_width );
our @EXPORT_OK = qw(generate_dhclient_intf_files
getInterfacesIPadresses
getPortRuleString
@@ -522,4 +525,21 @@ sub interface_description {
return $description;
}
+# returns (rows, columns) for terminal size
+sub get_terminal_size {
+ return Vyatta::ioctl::get_terminal_size();
+}
+
+# return only terminal width
+sub get_terminal_width {
+ my ($rows, $cols) = get_terminal_size;
+ return $cols;
+}
+
+# return only terminal height
+sub get_terminal_height {
+ my ($rows, $cols) = get_terminal_size;
+ return $rows;
+}
+
1;