]> git.xolatile.top Git - public-moontalk.git/commitdiff
update
authorEmil Williams <emilwilliams@tuta.io>
Wed, 7 Feb 2024 14:57:02 +0000 (14:57 +0000)
committerEmil Williams <emilwilliams@tuta.io>
Wed, 7 Feb 2024 14:57:02 +0000 (14:57 +0000)
client/moontalk.rb

index 16c1e8c68c4defc2ae558dfde58d93671f870979..02e7de3703debf48108aa2c62b9088764bd9f070 100644 (file)
@@ -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