ruby/trema/command/show_stats.rb in trema-0.4.6 vs ruby/trema/command/show_stats.rb in trema-0.4.7

- old
+ new

@@ -14,21 +14,21 @@ # with this program; if not, write to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. # -require "trema/cli" -require "trema/util" +require 'trema/cli' +require 'trema/util' module Trema module Command include Trema::Util - def trema_show_stats hostname, tx, rx - cli = get_cli( hostname ) + def trema_show_stats(hostname, tx, rx) + cli = get_cli(hostname) unless tx || rx show_tx_and_rx cli end cli.show_tx_stats if tx @@ -39,19 +39,19 @@ ############################################################################ private ############################################################################ - def show_tx_and_rx cli - puts "Sent packets:" + def show_tx_and_rx(cli) + puts 'Sent packets:' cli.show_tx_stats - puts "Received packets:" + puts 'Received packets:' cli.show_rx_stats end - def get_cli name - host = find_host_by_name( name ) + def get_cli(name) + host = find_host_by_name(name) exit_now! "unknown host: #{ name }" if host.nil? Trema::Cli.new host end end end