# frozen_string_literal: true

require 'dry/cli/completion/command'
require 'unisec/cli/bidi'
require 'unisec/cli/blocks'
require 'unisec/cli/confusables'
require 'unisec/cli/dump'
require 'unisec/cli/normalization'
require 'unisec/cli/planes'
require 'unisec/cli/properties'
require 'unisec/cli/rugrep'
require 'unisec/cli/size'
require 'unisec/cli/surrogates'
require 'unisec/cli/versions'

module Unisec
  # Module used to create the CLI for the executable
  module CLI
    # Registered commands for the CLI
    module Commands
      extend Dry::CLI::Registry

      # Mapping between the (sub-)commands as seen by the user
      # on the command-line interface and the CLI modules in the lib
      register 'bidi spoof', Bidi::Spoof
      register 'blocks invalid', Blocks::Invalid
      register 'blocks list', Blocks::List
      register 'blocks reverse', Blocks::Reverse
      register 'blocks search', Blocks::Search
      register 'completion', Dry::CLI::Completion::Command[self]
      register 'confusables list', Confusables::List
      register 'confusables randomize', Confusables::Randomize
      register 'dump codepoints integer', Dump::Codepoints::Integer
      register 'dump codepoints standard', Dump::Codepoints::Standard
      register 'dump dec', Dump::Dec
      register 'dump hex', Dump::Hex
      register 'dump rev', Dump::Reverse
      register 'grep', Grep
      register 'normalize all', Normalize::All
      register 'normalize replace', Normalize::Replace
      register 'normalize reverse', Normalize::Reverse
      register 'planes block', Planes::Block
      register 'planes list', Planes::List
      register 'planes reverse', Planes::Reverse
      register 'planes search', Planes::Search
      register 'properties char', Properties::Char
      register 'properties codepoints', Properties::Codepoints
      register 'properties list', Properties::List
      register 'size', Size
      register 'surrogates from', Surrogates::From
      register 'surrogates to', Surrogates::To
      register 'versions', Versions
    end
  end
end
