Class: Ronin::Nmap::CLI::Commands::Import Private

Inherits:
Ronin::Nmap::CLI::Command show all
Includes:
Importable
Defined in:
lib/ronin/nmap/cli/commands/import.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

The ronin-nmap import command.

Usage

ronin-nmap import [options] XML_FILE

Options

    --db NAME                    The database to connect to (Default: default)
    --db-uri URI                 The database URI to connect to
-h, --help                       Print help information

Arguments

XML_FILE                         The XML file to import

Instance Method Summary collapse

Methods included from Importable

#import_file, included

Instance Method Details

#run(xml_file) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Runs the ronin-nmap import command.

Parameters:

  • xml_file (String)

    The nmap XML file to import.



65
66
67
68
69
70
71
72
73
# File 'lib/ronin/nmap/cli/commands/import.rb', line 65

def run(xml_file)
  unless File.file?(xml_file)
    print_error "no such file or directory: #{xml_file}"
    exit(1)
  end

  db_connect
  import_file(xml_file)
end