2020use Symfony \Component \Console \Output \OutputInterface ;
2121
2222/**
23- * Download command
23+ * Download file command
2424 *
2525 * @category MageDownload
2626 * @package MageDownload
2929 * @license http://creativecommons.org/licenses/by/4.0/ CC BY 4.0
3030 * @link https://github.com/steverobbins/magedownload-cli
3131 */
32- class DownloadCommand extends AbstractCommand
32+ class FileCommand extends AbstractCommand
3333{
3434 /**
3535 * Configure command
@@ -39,12 +39,12 @@ class DownloadCommand extends AbstractCommand
3939 protected function configure ()
4040 {
4141 $ this
42- ->setName ('download ' )
42+ ->setName ('file ' )
4343 ->setDescription ('Download a release or patch ' )
4444 ->addArgument (
45- 'file ' ,
45+ 'name ' ,
4646 InputArgument::REQUIRED ,
47- 'The file to download '
47+ 'The name of the file to download '
4848 )
4949 ->addArgument (
5050 'destination ' ,
@@ -68,7 +68,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
6868 $ output ->writeln (sprintf ('Downloading to <info>%s</info>... ' , $ destination ));
6969 $ download = new Download ;
7070 $ result = $ download ->get (
71- $ input ->getArgument ('file ' ),
71+ $ input ->getArgument ('name ' ),
7272 $ this ->getAccountId ($ input ),
7373 $ this ->getAccessToken ($ input )
7474 );
@@ -91,13 +91,13 @@ private function getDestination(InputInterface $input)
9191 {
9292 $ dest = $ input ->getArgument ('destination ' );
9393 if (!$ dest ) {
94- return getcwd () . DIRECTORY_SEPARATOR . $ input ->getArgument ('file ' );
94+ return getcwd () . DIRECTORY_SEPARATOR . $ input ->getArgument ('name ' );
9595 }
9696 if (is_dir ($ dest )) {
9797 if (substr ($ dest , -1 ) !== '/ ' ) {
9898 $ dest .= DIRECTORY_SEPARATOR ;
9999 }
100- return $ dest . $ input ->getArgument ('file ' );
100+ return $ dest . $ input ->getArgument ('name ' );
101101 }
102102 return $ dest ;
103103 }
0 commit comments