# File lib/termtter/client.rb, line 176
      def call_commands(text)
        @task_manager.invoke_and_wait do
          # FIXME: This block can become Maybe Monad
          get_hooks("pre_command").each {|hook|
            break if text == nil # interrupt if hook returns nil
            text = hook.call(text)
          }
          return if text.empty?

          commands = find_commands(text)
          raise CommandNotFound, text if commands.empty?

          commands.each do |command|
            command_str, command_arg = Command.split_command_line(text)

            modified_arg = command_arg
            # FIXME: This block can become Maybe Monad
            get_hooks("modify_arg_for_#{command.name.to_s}").each {|hook|
              break if modified_arg == false # interrupt if hook return false
              modified_arg = hook.call(command_str, modified_arg)
            }

            begin
              call_hooks("pre_exec_#{command.name.to_s}", command, modified_arg)
              result = command.call(command_str, modified_arg, text) # exec command
              call_hooks("post_exec_#{command.name.to_s}", command_str, modified_arg, result)
            rescue CommandCanceled
            end
          end
          call_hooks("post_command", text)
        end
      end