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

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

Instance Method Summary collapse

Instance Method Details

#aliasesObject



24
25
26
# File 'lib/mercury/cli/commands/show.rb', line 24

def aliases
  []
end

#long_descObject



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

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



20
21
22
# File 'lib/mercury/cli/commands/show.rb', line 20

def name
  'show-status'
end

#option_definitionsObject



42
43
44
# File 'lib/mercury/cli/commands/show.rb', line 42

def option_definitions
  []
end

#run(options, arguments) ⇒ Object



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/mercury/cli/commands/show.rb', line 46

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



28
29
30
# File 'lib/mercury/cli/commands/show.rb', line 28

def short_desc
  'Create or update information from the network'
end

#usageObject



38
39
40
# File 'lib/mercury/cli/commands/show.rb', line 38

def usage
  "bootstrap show-status"
end