Class: Mercury::CLI::Commands::Show

Inherits:
Cri::Command
  • Object
show all
Defined in:
lib/mercury/cli/commands/show.rb

Overview

Displays a summary of the realm data found in the configured Mercury server.

Author:

  • David Love

Instance Method Summary collapse

Instance Method Details

#aliasesObject

The aliases this sub-command is known by



33
34
35
# File 'lib/mercury/cli/commands/show.rb', line 33

def aliases
  []
end

#long_descObject

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

#nameObject

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_definitionsObject

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(options, 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_descObject

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

#usageObject

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