module Ronin::CLI::TypoOptions

Adds options for enabling typo generator rules.

## Options

--omit-chars                 Toggles whether to omit repeated characters
--repeat-chars               Toggles whether to repeat single characters
--swap-chars                 Toggles whether to swap certain common character pairs
--change-suffix              Toggles whether to change the suffix of words

Public Class Methods

included(command) click to toggle source

Adds typo options to the command.

@param [Class<Command>] command

The command including {TypoOptions}.
# File lib/ronin/cli/typo_options.rb, line 40
def self.included(command)
  command.option :omit_chars, desc: 'Toggles whether to omit repeated characters' do
    @typo_kwargs[:emit_chars] = true
  end

  command.option :repeat_chars, desc: 'Toggles whether to repeat single characters' do
    @typo_kwargs[:repeat_chars] = true
  end

  command.option :swap_chars, desc: 'Toggles whether to swap certain common character pairs' do
    @typo_kwargs[:swap_chars] = true
  end

  command.option :change_suffix, desc: 'Toggles whether to change the suffix of words' do
    @typo_kwargs[:change_suffix] = true
  end
end
new(**kwargs) click to toggle source

Initializes the command.

@param [Hash{Symbol => Object}] kwargs

Additional keyword arguments.
Calls superclass method
# File lib/ronin/cli/typo_options.rb, line 64
def initialize(**kwargs)
  super(**kwargs)

  @typo_kwargs = {}
end

Public Instance Methods

typo_generator() click to toggle source

The typo generator.

@return [Ronin::Support::Text::Typo::Generator]

# File lib/ronin/cli/typo_options.rb, line 75
def typo_generator
  @typo_generator ||= Support::Text::Typo.generator(**@typo_kwargs)
end