diff --git a/apps/files/lib/Command/ListFiles.php b/apps/files/lib/Command/ListFiles.php index e36aae402796d..1a96d7a63226b 100644 --- a/apps/files/lib/Command/ListFiles.php +++ b/apps/files/lib/Command/ListFiles.php @@ -42,11 +42,11 @@ protected function configure(): void { parent::configure(); $this->setName("files:list") - ->setDescription("List filesystem in the path mentioned in path argument") + ->setDescription("List files of the user and filter by path, type, size optionally") ->addArgument( - "user", + "user_id", InputArgument::REQUIRED, - 'List the files and folder belonging to the user, eg occ files:list user="admin", the user being a required argument' + 'List the files and folder belonging to the user, eg occ files:list admin, the user_id being a required argument' ) ->addOption("path", "", InputArgument::OPTIONAL, "List files inside a particular path of the user, if not mentioned list from user's root directory") ->addOption("type", "", InputArgument::OPTIONAL, "Filter by type like application, image, video etc") @@ -153,12 +153,9 @@ protected function execute( InputInterface $input, OutputInterface $output ): int { - $user = $input->getArgument("user"); - $user = ltrim($user, "user="); - + $user = $input->getArgument("user_id"); $this->initTools($output); - if ($this->userManager->userExists($user)) { $output->writeln( "Starting list for user ($user)" @@ -166,7 +163,7 @@ protected function execute( $this->listFiles( $user, $output, - (string) $input->getOption("path"), + (string) $input->getOption("path") ? $input->getOption("path") : '', $input->getOption("type"), (int) $input->getOption("minSize"), (int) $input->getOption("maxSize") @@ -179,7 +176,6 @@ protected function execute( return self::FAILURE; } - $this->presentStats($input, $output); return self::SUCCESS; }