@@ -31,6 +31,7 @@ protected function configure() {
3131 ->setName ('branch ' )
3232 ->setDescription ('Create branches across repos ' )
3333 ->addOption ('path ' , NULL , InputOption::VALUE_REQUIRED , 'The local base path to search ' , getcwd ())
34+ ->addOption ('max-depth ' , NULL , InputOption::VALUE_REQUIRED , 'Limit the depth of the search ' , -1 )
3435 ->addOption ('prefix ' , 'p ' , InputOption::VALUE_NONE , 'Autodetect prefixed variations ' )
3536 ->addOption ('delete ' , 'd ' , InputOption::VALUE_NONE , 'Delete fully merged branches ' )
3637 ->addOption ('force-delete ' , 'D ' , InputOption::VALUE_NONE , 'Delete branch (even if not merged) ' )
@@ -60,7 +61,7 @@ protected function executeCreate(InputInterface $input, OutputInterface $output)
6061
6162 $ helper = $ this ->getHelper ('question ' );
6263 $ scanner = new \GitScan \GitRepoScanner ();
63- $ gitRepos = $ scanner ->scan ($ input ->getOption ('path ' ));
64+ $ gitRepos = $ scanner ->scan ($ input ->getOption ('path ' ), $ input -> getOption ( ' max-depth ' ) );
6465 $ batch = new ProcessBatch ('Creating branch(es)... ' );
6566 $ self = $ this ;
6667
@@ -103,7 +104,7 @@ function (GitRepo $gitRepo, $oldBranch, $newBranch) use ($input, $output, $helpe
103104 protected function executeDelete (InputInterface $ input , OutputInterface $ output ): int {
104105 $ helper = $ this ->getHelper ('question ' );
105106 $ scanner = new \GitScan \GitRepoScanner ();
106- $ gitRepos = $ scanner ->scan ($ input ->getOption ('path ' ));
107+ $ gitRepos = $ scanner ->scan ($ input ->getOption ('path ' ), $ input -> getOption ( ' max-depth ' ) );
107108 $ batch = new ProcessBatch ('Deleting branch(es)... ' );
108109
109110 $ branchName = $ input ->getArgument ('branchName ' );
0 commit comments