@@ -42,11 +42,11 @@ protected function configure(): void {
4242 parent ::configure ();
4343
4444 $ this ->setName ("files:list " )
45- ->setDescription ("List filesystem in the path mentioned in path argument " )
45+ ->setDescription ("List files of the user and filter by path, type, size optionally " )
4646 ->addArgument (
47- "user " ,
47+ "user_id " ,
4848 InputArgument::REQUIRED ,
49- 'List the files and folder belonging to the user, eg occ files:list user=" admin" , the user being a required argument '
49+ 'List the files and folder belonging to the user, eg occ files:list admin, the user_id being a required argument '
5050 )
5151 ->addOption ("path " , "" , InputArgument::OPTIONAL , "List files inside a particular path of the user, if not mentioned list from user's root directory " )
5252 ->addOption ("type " , "" , InputArgument::OPTIONAL , "Filter by type like application, image, video etc " )
@@ -153,20 +153,17 @@ protected function execute(
153153 InputInterface $ input ,
154154 OutputInterface $ output
155155 ): int {
156- $ user = $ input ->getArgument ("user " );
157- $ user = ltrim ($ user , "user= " );
158-
156+ $ user = $ input ->getArgument ("user_id " );
159157 $ this ->initTools ($ output );
160158
161-
162159 if ($ this ->userManager ->userExists ($ user )) {
163160 $ output ->writeln (
164161 "Starting list for user ( $ user) "
165162 );
166163 $ this ->listFiles (
167164 $ user ,
168165 $ output ,
169- (string ) $ input ->getOption ("path " ),
166+ (string ) $ input ->getOption ("path " ) ? $ input -> getOption ( " path " ) : '' ,
170167 $ input ->getOption ("type " ),
171168 (int ) $ input ->getOption ("minSize " ),
172169 (int ) $ input ->getOption ("maxSize " )
@@ -179,7 +176,6 @@ protected function execute(
179176 return self ::FAILURE ;
180177 }
181178
182-
183179 $ this ->presentStats ($ input , $ output );
184180 return self ::SUCCESS ;
185181 }
0 commit comments