88use SchedulerBundle \SchedulerInterface ;
99use SchedulerBundle \Task \TaskInterface ;
1010use Symfony \Component \Console \Command \Command ;
11+ use Symfony \Component \Console \Input \InputArgument ;
1112use Symfony \Component \Console \Input \InputInterface ;
1213use Symfony \Component \Console \Input \InputOption ;
1314use Symfony \Component \Console \Output \OutputInterface ;
@@ -42,8 +43,8 @@ protected function configure(): void
4243 $ this
4344 ->setDescription ('Export tasks to a specific format ' )
4445 ->setDefinition ([
45- new InputOption ('format ' , null , InputOption:: VALUE_OPTIONAL , 'The format used to export tasks ' , 'crontab ' ),
46- new InputOption ('filename ' , null , InputOption::VALUE_OPTIONAL , 'The name of the filename used to export tasks ' , 'crontab ' ),
46+ new InputArgument ('format ' , InputArgument:: REQUIRED , 'The format used to export tasks ' , 'crontab ' ),
47+ new InputOption ('filename ' , null , InputOption::VALUE_OPTIONAL , 'The name of the filename used to export tasks ' , '/etc/cron.d ' ),
4748 ])
4849 ;
4950 }
@@ -64,7 +65,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
6465 }
6566
6667 $ filename = $ input ->getOption ('filename ' );
67- $ exporter = $ this ->exporterRegistry ->find ($ input ->getOption ('format ' ));
68+ $ exporter = $ this ->exporterRegistry ->find ($ input ->getArgument ('format ' ));
6869
6970 $ tasks ->walk (function (TaskInterface $ task ) use ($ exporter , $ filename ): void {
7071 $ exporter ->export ($ filename , $ task );
0 commit comments