diff options
author | Saurabh Mohan <saurabh@vyatta.com> | 2012-05-16 12:11:54 -0700 |
---|---|---|
committer | Saurabh Mohan <saurabh@vyatta.com> | 2012-05-16 12:11:54 -0700 |
commit | b749b89dba6238c24eba2606d3c47410d5aa4e1f (patch) | |
tree | 87ee17f14a5c06093ac1761f05a3651cfd191fe9 /lib/Vyatta/Misc.pm | |
parent | 0b7d9d5131d41684d8fc59dfc712998f83659127 (diff) | |
parent | a0f15feda0d584863fa3b45bdbd61fb5146a7e14 (diff) | |
download | vyatta-cfg-b749b89dba6238c24eba2606d3c47410d5aa4e1f.tar.gz vyatta-cfg-b749b89dba6238c24eba2606d3c47410d5aa4e1f.zip |
Merge branch 'pacifica' of http://git.vyatta.com/vyatta-cfg into pacifica
Diffstat (limited to 'lib/Vyatta/Misc.pm')
-rwxr-xr-x | lib/Vyatta/Misc.pm | 22 |
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; |