1. require "io/console"
  2. requrie "open3"
  3.  
  4. class MahCLI
  5. def menu
  6. menustr = ""
  7. menustr << "blaa blaa"
  8. menustr << "blaaah"
  9. menustr
  10. end
  11.  
  12. def get_action
  13. STDIN.getch
  14. end
  15.  
  16. def shell cmd, *args
  17. Open3.popen3(cmd, *args) do |in,out,err,wait|
  18. wait.join
  19. out.read
  20. end
  21. end
  22. def get_ip
  23. shell "ifconcig"
  24. end
  25.  
  26. def nmap
  27. ## blaablaa
  28. end
  29. def run
  30. loop do
  31. puts menu
  32. case get_action
  33. when "1" then get_ip
  34. when "2" then blaablaa
  35. end
  36. end
  37. end
  38. end
  39.  
  40. begin
  41. if __FILE__ == $0
  42. MahCLI.new.run
  43. end
  44. end
  45. ß