Sha256: a333ce52a36f9bd483ce1b53c4a354fcc1978f2e3fde2cb30d460744028fa4dc

Contents?: true

Size: 784 Bytes

Versions: 1

Compression:

Stored size: 784 Bytes

Contents

module Nmapr
  module Options
    module Targets 
      def target(arg)
        @targets << arg
      end

      def target_file(arg)
        add_argument("-iL " << arg)
      end
      
      def exclude_file(arg)
        add_argument("--excludefile " << arg)
      end

      def exclude(*args)
        args.each do |arg|
          case arg
          when String
            @not_targets << arg
          when Array
            arg.each { |a| exclude(a) }
          end
        end
      end
      
      def targets(*args)
        args.each do |arg|
          case arg
          when String
            target(arg)
          when Array
            arg.each { |a| targets(a) }
          end
        end
      end

      alias ips targets
      alias hosts targets
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nmapr-1.0.0 lib/nmapr/options/targets.rb