handle_mode (Raggle::CLI)

    # File raggle, line 2158
        def CLI::handle_mode(opts)
          case opts['mode']
          when 'list'
            CLI::list_feeds
            exit(0)
          when 'add'
            added = Engine::add_feed opts
            Engine::save_feed_list if added
            exit(0)
          when 'delete'
            Engine::delete_feed opts['id']
            Engine::save_feed_list
            exit(0)
          when 'invalidate'
            Engine::invalidate_feed opts['id']
            Engine::save_feed_list
            exit(0)
          when 'edit'
            Engine::edit_feed opts['id'], opts
            Engine::save_feed_list
            exit(0)
          when 'sort'
            Engine::sort_feeds
            Engine::save_feed_list
            exit(0)
          when 'update'
            # start grab log
            Engine.start_grab_log

            grab_meth = Engine.method(:grab_feed)
            if opts['id'] == 'all'
              $config['feeds'].each { |feed| grab_meth.call(feed) }
            else
              feed = $config['feeds'].get(opts['id'])
              grab_meth.call(feed)
              ids = [opts['id']]
            end

            # save changes to feed list
            Engine::save_feed_list

            exit(0)
          when 'purge'
            Engine::purge_feed_cache
            exit(0)
          when 'import_opml'
            OPML::import opts['opml_file'], opts['refresh'], opts['lock_title?'], opts['save_items?'],
              opts['force']
            Engine::save_feed_list
            exit(0)
          when 'export_opml'
            OPML::export opts['opml_file']
            exit(0)
          when 'find_feeds'
            CLI::find_feeds(opts['find_str'])
            exit(0)
          when 'default_config'
            CLI::default_config
            exit(0)
          end

          # enable ascii mode if requested
          $config['use_ascii_only?'] = true if opts['ascii']
        end