lib/sample_cmdlet_patterns/commands/key_reader.rb
# Execute KeyReader command taking input from a input stream
# and writing to output stream
#
# sample: output.puts 'OK'
Execute KeyReader command taking input from a input stream
and writing to output stream


Execute KeyReader command taking input from a input stream and writing to output stream
def execute(input: $stdin, output: $stdout)
        loop do
          case @subcommand
          when :gui
            gui
          when :read_keypress
            require_relative 'key_reader_read_keypress'
            subcmd = SampleCmdletPatterns::Commands::KeyReaderReadKeypress.new({})
          when :read_line
            require_relative 'key_reader_read_line'
            subcmd = SampleCmdletPatterns::Commands::KeyReaderReadLine.new({})
          when :read_multiline
            require_relative 'key_reader_read_multiline'
            subcmd = SampleCmdletPatterns::Commands::KeyReaderReadMultiline.new({})
          when :on
            require_relative 'key_reader_on'
            subcmd = SampleCmdletPatterns::Commands::KeyReaderOn.new({})
          else
            break
          end
          @subcommand = subcmd&.execute(input: input, output: output)
        end
      end
def execute ( input : $stdin , output : $stdout ) loop do case @subcommand when :gui gui when :read_keypress require_relative 'key_reader_read_keypress' subcmd = SampleCmdletPatterns :: Commands :: KeyReaderReadKeypress . new ( { } ) when :read_line require_relative 'key_reader_read_line' subcmd = SampleCmdletPatterns :: Commands :: KeyReaderReadLine . new ( { } ) when :read_multiline require_relative 'key_reader_read_multiline' subcmd = SampleCmdletPatterns :: Commands :: KeyReaderReadMultiline . new ( { } ) when :on require_relative 'key_reader_on' subcmd = SampleCmdletPatterns :: Commands :: KeyReaderOn . new ( { } ) else break end @subcommand = subcmd &. execute ( input : input , output : output ) end end
Execute KeyReader command taking input from a input stream
and writing to output stream
Execute KeyReader command taking input from a input stream and writing to output stream
input
output