Class: Mercury::CLI::Commands::Show
- Inherits:
-
Cri::Command
- Object
- Cri::Command
- Mercury::CLI::Commands::Show
- Defined in:
- lib/mercury/cli/commands/show.rb
Overview
Displays a summary of the realm data found in the configured Mercury server.
Instance Method Summary collapse
-
#aliases ⇒ Object
The aliases this sub-command is known by.
-
#long_desc ⇒ Object
A longer description, detailing both the purpose and the use of this command.
-
#name ⇒ Object
The name of the sub-command (as it appears in the command line app).
-
#option_definitions ⇒ Object
Define the options for this command.
-
#run(options, arguments) ⇒ Object
Execute the command.
-
#short_desc ⇒ Object
A short help text describing the purpose of this command.
-
#usage ⇒ Object
Show the user the basic syntax of this command.
Instance Method Details
#aliases ⇒ Object
The aliases this sub-command is known by
33 34 35 |
# File 'lib/mercury/cli/commands/show.rb', line 33 def aliases [] end |
#long_desc ⇒ Object
A longer description, detailing both the purpose and the use of this command
44 45 46 47 48 |
# File 'lib/mercury/cli/commands/show.rb', line 44 def long_desc "Displays the current state of the evironemnt " + "to update the host files (held in the 'hosts' directory). Existing " + "information will be updated, and missing information inserted.\n" end |
#name ⇒ Object
The name of the sub-command (as it appears in the command line app)
28 29 30 |
# File 'lib/mercury/cli/commands/show.rb', line 28 def name 'show-status' end |
#option_definitions ⇒ Object
Define the options for this command
56 57 58 |
# File 'lib/mercury/cli/commands/show.rb', line 56 def option_definitions [] end |
#run(options, arguments) ⇒ Object
Execute the command
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
# File 'lib/mercury/cli/commands/show.rb', line 61 def run(, arguments) # Load the list of groups group_list = YAML::load( File.open("config/groups.yaml")) # Load the list of networks network_list = YAML::load( File.open("config/networks.yaml")) # Update the information in each group-network directory gn_name_list = Array.new network_list.each{|network| puts network[1] net_block = network[1]['ip4-address-block'].to_s # Scan this network # parser = Nmap::Parser.parsescan("nmap", "-sVC " + net_block) puts parser } end |
#short_desc ⇒ Object
A short help text describing the purpose of this command
38 39 40 |
# File 'lib/mercury/cli/commands/show.rb', line 38 def short_desc 'Create or update information from the network' end |
#usage ⇒ Object
Show the user the basic syntax of this command
51 52 53 |
# File 'lib/mercury/cli/commands/show.rb', line 51 def usage "bootstrap show-status" end |