@@ -30,6 +30,7 @@ class FindFilesCommand extends Command
3030 protected static $ defaultName = 'debricked:files:find ' ;
3131
3232 private const OPTION_JSON = 'json ' ;
33+ private const OPTION_LOCK_FILE_ONLY = 'lockfile ' ;
3334
3435 private HttpClientInterface $ debrickedClient ;
3536
@@ -78,6 +79,12 @@ protected function configure(): void
7879 InputOption::VALUE_REQUIRED ,
7980 'Enter a comma separated list of directories to exclude. Such as: --excluded-directories="vendor,node_modules,tests" ' ,
8081 'vendor,node_modules,tests '
82+ )
83+ ->addOption (
84+ self ::OPTION_LOCK_FILE_ONLY ,
85+ 'l ' ,
86+ InputOption::VALUE_NONE ,
87+ 'Use this option to output lock files only '
8188 );
8289 }
8390
@@ -101,6 +108,7 @@ public function execute(InputInterface $input, OutputInterface $output): int
101108 $ searchDirectory = preg_replace ('#/+# ' , '/ ' , $ searchDirectory ); // remove duplicate slashes.
102109
103110 $ recursiveFileSearch = (bool ) $ input ->getOption (FindAndUploadFilesCommand::OPTION_RECURSIVE_FILE_SEARCH );
111+
104112 $ directoriesToExcludeString = $ input ->getOption (FindAndUploadFilesCommand::OPTION_DIRECTORIES_TO_EXCLUDE );
105113 $ directoriesToExcludeArray = [];
106114 if (empty ($ directoriesToExcludeString ) === false ) {
@@ -109,8 +117,10 @@ public function execute(InputInterface $input, OutputInterface $output): int
109117 $ io ->note ('No directories will be ignored ' );
110118 }
111119
120+ $ lockFileOnly = (bool ) $ input ->getOption (self ::OPTION_LOCK_FILE_ONLY );
121+
112122 try {
113- $ fileGroups = FileGroupFinder::find ($ api , $ searchDirectory , $ recursiveFileSearch , $ directoriesToExcludeArray );
123+ $ fileGroups = FileGroupFinder::find ($ api , $ searchDirectory , $ recursiveFileSearch , $ directoriesToExcludeArray, $ lockFileOnly );
114124 } catch (TransportExceptionInterface $ e ) {
115125 $ io ->error ("Failed to get supported dependency file names: {$ e ->getMessage ()}" );
116126
0 commit comments