Sha256: f04ce3dfd419d2370e3bfced3d7e4dbf8e130f06be3ccd0571e9d2703107f127

Contents?: true

Size: 980 Bytes

Versions: 7

Compression:

Stored size: 980 Bytes

Contents

require "gm/notepad/input_handlers/default_handler"
module Gm
  module Notepad
    module InputHandlers
      class HelpHandler < DefaultHandler
        HELP_PREFIX = '?'.freeze

        def self.handles?(input:)
          return false unless input[0] == HELP_PREFIX
          true
        end

        def after_initialize!
          self.to_interactive = true
          self.to_output = false
          self.expand_line = false
        end

        def lines
          [
            "Prefixes:",
            "\t? - Help (this command)",
            "\t+ - Query table names and contents",
            "\t<table_name: - Write the results to the given table",
            "",
            "Tokens:",
            "\t! - Skip expansion",
            "\t/search/ - Grep for the given 'search' within the prefix",
            "\t[index] - Target a specific 'index'",
            "\t{table_name} - expand_line the given 'table_name'"
          ]
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
gm-notepad-0.0.10 lib/gm/notepad/input_handlers/help_handler.rb
gm-notepad-0.0.9 lib/gm/notepad/input_handlers/help_handler.rb
gm-notepad-0.0.8 lib/gm/notepad/input_handlers/help_handler.rb
gm-notepad-0.0.6 lib/gm/notepad/input_handlers/help_handler.rb
gm-notepad-0.0.5 lib/gm/notepad/input_handlers/help_handler.rb
gm-notepad-0.0.4 lib/gm/notepad/input_handlers/help_handler.rb
gm-notepad-0.0.3 lib/gm/notepad/input_handlers/help_handler.rb