diff --git a/client/moontalk.rb b/client/moontalk.rb index 16c1e8c..02e7de3 100644 --- a/client/moontalk.rb +++ b/client/moontalk.rb @@ -60,14 +60,15 @@ end def main begin + h = { "-name" => 1, "-nick" => 1, "-serv" => 2, "-port" => 3 } + ARGV.each_with_index do |element,index| - if element == "-name" + case h[element] + when h["-name"] @name = ARGV[index + 1] - end - if element == "-serv" + when h["-serv"] @serv = ARGV[index + 1] - end - if element == "-port" + when h["-port"] @port = ARGV[index + 1].to_i end end