def parse_and_execute(options, argv)
      @options = defaults(options)
      begin
        command_args = option_parser(@options).order(argv)
      rescue OptionParser::AmbiguousOption => e
        puts e.message
        return false
      end
      if @options.exit
        return @options.exit_value.nil? || true
      end

      if command_args.empty?
        puts "missing command try '#{self.class.command} -h' for help"
        return false
      end

      command_name = command_args.first
      command_args = command_args[1..-1]

      command_class = self.class.find_command(command_name)
      return false if command_class.nil?

      command = command_class.new
      command.main = self
      if @catch_exception
        begin
          ret = command.parse_and_execute(@options, command_args)
        rescue
          puts "I am so sorry! Something went wrong! (exception #{$!.to_s})"
          return false
        end
      else
        ret = command.parse_and_execute(@options, command_args)
      end
      ret
    end
def parse_and_execute(options, argv)
      @options = defaults(options)
      begin
        command_args = option_parser(@options).order(argv)
      rescue OptionParser::AmbiguousOption => e
        puts e.message
        return false
      end
      if @options.exit
        return @options.exit_value.nil? || true
      end

      if command_args.empty?
        puts "missing command try '#{self.class.command} -h' for help"
        return false
      end

      command_name = command_args.first
      command_args = command_args[1..-1]

      command_class = self.class.find_command(command_name)
      return false if command_class.nil?

      command = command_class.new
      command.main = self
      if @catch_exception
        begin
          ret = command.parse_and_execute(@options, command_args)
        rescue
          puts "I am so sorry! Something went wrong! (exception #{$!.to_s})"
          return false
        end
      else
        ret = command.parse_and_execute(@options, command_args)
      end
      ret
    end
module ClassMethods

 for top level command (Main) options is nil