Class: Mu::Command::Cmd_cli
- Inherits:
-
Mu::Command
- Object
- Mu::Command
- Mu::Command::Cmd_cli
- Defined in:
- lib/mu/command/cmd_cli.rb
Constant Summary
Constants inherited from Mu::Command
Instance Attribute Summary collapse
-
#api ⇒ Object
Returns the value of attribute api.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#cmd_cli_help(argv) ⇒ Object
runs the cli help command * argv = command-line arguments.
-
#cmd_help(argv) ⇒ Object
displays command-line help.
-
#cmd_history(argv) ⇒ Object
displays the command line history for the current session * argv = command-line arguments.
-
#cmd_ping(argv) ⇒ Object
pings an ip address * argv = command-line arguments, requires an ip address (-a) argument.
-
#cmd_question(argv) ⇒ Object
runs the cli command ‘?“ * argv = command-line arguments.
-
#cmd_traceroute(argv) ⇒ Object
runs traceroute on an ip address * argv = command-line arguments, requires an ip address (-a) argument.
Methods included from Helper
#ask, #error, #format_float, #get_file_as_string_array, #msg, #shift, #to_boolean
Instance Attribute Details
#api ⇒ Object
Returns the value of attribute api.
6 7 8 |
# File 'lib/mu/command/cmd_cli.rb', line 6 def api @api end |
#host ⇒ Object
Returns the value of attribute host.
6 7 8 |
# File 'lib/mu/command/cmd_cli.rb', line 6 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/mu/command/cmd_cli.rb', line 6 def password @password end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/mu/command/cmd_cli.rb', line 6 def username @username end |
Instance Method Details
#cmd_cli_help(argv) ⇒ Object
runs the cli help command
* argv = command-line arguments
15 16 17 18 |
# File 'lib/mu/command/cmd_cli.rb', line 15 def cmd_cli_help argv setup argv msg run_cmd("help") end |
#cmd_help(argv) ⇒ Object
displays command-line help
9 10 11 |
# File 'lib/mu/command/cmd_cli.rb', line 9 def cmd_help argv help end |
#cmd_history(argv) ⇒ Object
displays the command line history for the current session
* argv = command-line arguments
29 30 31 32 |
# File 'lib/mu/command/cmd_cli.rb', line 29 def cmd_history argv setup argv msg run_cmd("history") end |
#cmd_ping(argv) ⇒ Object
pings an ip address
* argv = command-line arguments, requires an ip address (-a) argument
36 37 38 39 40 |
# File 'lib/mu/command/cmd_cli.rb', line 36 def cmd_ping argv setup argv addr = @hash["address"] msg run_cmd("ping #{addr}") end |
#cmd_question(argv) ⇒ Object
runs the cli command ‘?“
* argv = command-line arguments
22 23 24 25 |
# File 'lib/mu/command/cmd_cli.rb', line 22 def cmd_question argv setup argv msg run_cmd("?") end |
#cmd_traceroute(argv) ⇒ Object
runs traceroute on an ip address
* argv = command-line arguments, requires an ip address (-a) argument
44 45 46 47 48 |
# File 'lib/mu/command/cmd_cli.rb', line 44 def cmd_traceroute argv setup argv addr = @hash["address"] msg run_cmd("traceroute #{addr}") end |