setName('torrents:search:series') ->setDescription('Search series') ->addArgument('query', InputArgument::REQUIRED, 'Query') ->addOption('offset', 'o', InputOption::VALUE_REQUIRED, 'Page number') ->addOption('limit', 'l', InputOption::VALUE_REQUIRED, 'Number of results per page') ->addOption('terms', 't', InputOption::VALUE_REQUIRED, 'Filter by terms IDs (separated by ",")') ->setHelp("%command.name% Search series. Usage: torrents:search:series QUERY [OPTIONS] --terms does not work (API bug)"); } protected function execute(InputInterface $input, OutputInterface $output) { $inputData = array( 'command' => 'torrents:search', 'query' => $input->getArgument('query'), '--sub-category' => 433, ); foreach (['offset', 'limit', 'terms'] as $p) { $value = $input->getOption($p); if (null !== $value) { $inputData['--'.$p] = $value; } } return $this->getApplication()->doRun(new ArrayInput($inputData), $output); } }