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


Execute Which 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 :which
            require_relative 'which_which'
            subcmd = SampleCmdletPatterns::Commands::WhichWhich.new({})
          when :exist
            require_relative 'which_exist'
            subcmd = SampleCmdletPatterns::Commands::WhichExist.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 :which require_relative 'which_which' subcmd = SampleCmdletPatterns :: Commands :: WhichWhich . new ( { } ) when :exist require_relative 'which_exist' subcmd = SampleCmdletPatterns :: Commands :: WhichExist . new ( { } ) else break end @subcommand = subcmd &. execute ( input : input , output : output ) end end
Execute Which command taking input from a input stream
and writing to output stream
Execute Which command taking input from a input stream and writing to output stream
input
output