1515use Symfony \Component \Console \Helper \ProgressBar ;
1616use Symfony \Component \Console \Input \InputArgument ;
1717use Symfony \Component \Console \Input \InputInterface ;
18+ use Symfony \Component \Console \Input \InputOption ;
1819use Symfony \Component \Console \Output \OutputInterface ;
1920use Symfony \Component \Console \Question \ConfirmationQuestion ;
2021
2324 */
2425class DeleteObsoleteCommand extends ContainerAwareCommand
2526{
27+ use BundleTrait;
28+
2629 protected function configure ()
2730 {
2831 $ this
2932 ->setName ('translation:delete-obsolete ' )
3033 ->setDescription ('Delete all translations marked as obsolete. ' )
3134 ->addArgument ('configuration ' , InputArgument::OPTIONAL , 'The configuration to use ' , 'default ' )
32- ->addArgument ('locale ' , InputArgument::OPTIONAL , 'The locale ot use. If omitted, we use all configured locales. ' , null );
35+ ->addArgument ('locale ' , InputArgument::OPTIONAL , 'The locale ot use. If omitted, we use all configured locales. ' , null )
36+ ->addOption ('bundle ' , 'b ' , InputOption::VALUE_REQUIRED , 'The bundle you want remove translations from. ' )
37+ ;
3338 }
3439
3540 protected function execute (InputInterface $ input , OutputInterface $ output )
@@ -43,6 +48,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
4348
4449 $ catalogueManager = $ container ->get ('php_translation.catalogue_manager ' );
4550 $ config = $ container ->get ('php_translation.configuration_manager ' )->getConfiguration ($ configName );
51+ $ this ->configureBundleDirs ($ input , $ config );
4652 $ catalogueManager ->load ($ container ->get ('php_translation.catalogue_fetcher ' )->getCatalogues ($ config , $ locales ));
4753
4854 $ storage = $ container ->get ('php_translation.storage. ' .$ configName );
0 commit comments