Skip to content

Commit

Permalink
Adding deprecated file command notice
Browse files Browse the repository at this point in the history
  • Loading branch information
steverobbins committed Dec 22, 2015
1 parent 4824041 commit ac80bb1
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
58 changes: 58 additions & 0 deletions src/MageDownload/Command/FileCommand.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?php
/**
* Magedownload CLI
*
* PHP version 5
*
* @category MageDownload
* @package MageDownload
* @author Steve Robbins <steve@steverobbins.com>
* @copyright 2015 Steve Robbins
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
* @link https://github.com/steverobbins/magedownload-cli
*/

namespace MageDownload\Command;

use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
* Deprecated file command
*
* @category MageDownload
* @package MageDownload
* @author Steve Robbins <steve@steverobbins.com>
* @copyright 2015 Steve Robbins
* @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
* @link https://github.com/steverobbins/magedownload-cli
*/
class FileCommand extends DownloadCommand
{
const NAME = 'file';

/**
* Configure command
*
* @return void
*/
protected function configure()
{
parent::configure();
$this->setName(self::NAME);
}

/**
* Execute command
*
* @param InputInterface $input
* @param OutputInterface $output
*
* @return void
*/
protected function execute(InputInterface $input, OutputInterface $output)
{
$output->writeln('<error>The "file" command is deprecated. Please use "download" instead.</error>');
return parent::execute($input, $output);
}
}
2 changes: 2 additions & 0 deletions src/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,15 @@

use MageDownload\Command\ConfigureCommand;
use MageDownload\Command\DownloadCommand;
use MageDownload\Command\FileCommand;
use MageDownload\Command\InfoCommand;
use Symfony\Component\Console\Application;

$app = new Application('MageDownload CLI', '1.3.0');

$app->add(new ConfigureCommand);
$app->add(new DownloadCommand);
$app->add(new FileCommand);
$app->add(new InfoCommand);

$app->run();

0 comments on commit ac80bb1

Please sign in to comment.