func (m *SearchCommand) Execute(args []string) error {
	torrents, err := m.GetTorrents(m.Args.Query)
	if err != nil {
		return err
	}
	torrents = m.GetFilters().FilterTorrentsCount(torrents, m.Count)
	if Options.JSON {
		torrentsJSON, err := json.MarshalIndent(torrents, "", "   ")
		if err != nil {
			return err
		}
		log.Println(string(torrentsJSON))
	} else if m.MagnetLink {
		for _, torrent := range torrents {
			log.Println(torrent.Magnet)
		}
	} else if m.TorrentURL {
		for _, torrent := range torrents {
			log.Println(torrent.FullURL())
		}
	} else {
		log.Println(getTorrentsTable(torrents))
	}
	return nil
}
Execute is the callback of the mirrors command.
package main
import (
	"bytes"
	"encoding/json"
	"log"
	"goirate/torrents"
	"github.com/olekukonko/tablewriter"
)
type SearchCommand struct {
	torrentSearchArgs
	Args positionalArgs `positional-args:"1" required:"1"`
}