def invoke(name, args=ARGV)
      logger.debug "invoke name: #{name}, args #{args.inspect}, configuration defined: #{configuration ? 'yes' : 'no'}"
      args = args.dup
      load_tasks

      logger.debug "find_by_namespace: #{name}"
      klass, task  = find_by_namespace(name)

      if klass
        config = {}
        config[:shell] ||= shell
        klass.send(:dispatch, task, args, nil, config) do |instance|
          if defined?(instance.configuration)
            instance.configuration = configuration.deep_clone
          end
        end
        logger.debug "after invoke"
        result = 0
      else
        puts "Could not find task #{name}"
        result = 1
      end
      result
    end
def invoke(name, args=ARGV)
      logger.debug "invoke name: #{name}, args #{args.inspect}, configuration defined: #{configuration ? 'yes' : 'no'}"
      args = args.dup
      load_tasks

      logger.debug "find_by_namespace: #{name}"
      klass, task  = find_by_namespace(name)

      if klass
        config = {}
        config[:shell] ||= shell
        klass.send(:dispatch, task, args, nil, config) do |instance|
          if defined?(instance.configuration)
            instance.configuration = configuration.deep_clone
          end
        end
        logger.debug "after invoke"
        result = 0
      else
        puts "Could not find task #{name}"
        result = 1
      end
      result
    end
@examples:

     invoke(sweep:screenshots)
     invoke(update:models)
     invoke(generate:init, ["."], nil)