Command/ConvertCommand.php
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $fileToConvert = $this->determineFile($output, $input->getArgument('file'));
        $newFormat = $input->getArgument('format');

        $newConfig = $this
            ->getContainer()
            ->get('tuck_converter.config_format_converter')
            ->convertFile($fileToConvert, $newFormat);

        if ($input->getOption('output')) {
            $output->write($newConfig);
        } else {
            $this->writeToFile($output, $fileToConvert, $newConfig, $newFormat);
        }
    }
protected function execute(InputInterface $input, OutputInterface $output)
    {
        $fileToConvert = $this->determineFile($output, $input->getArgument('file'));
        $newFormat = $input->getArgument('format');

        $newConfig = $this
            ->getContainer()
            ->get('tuck_converter.config_format_converter')
            ->convertFile($fileToConvert, $newFormat);

        if ($input->getOption('output')) {
            $output->write($newConfig);
        } else {
            $this->writeToFile($output, $fileToConvert, $newConfig, $newFormat);
        }
    }
Interactively determine the file and convert it

@param  InputInterface  $input
@param  OutputInterface $output
@return void