From 2dd5854d0958203f660328fdb3c2a6b3f9c362e0 Mon Sep 17 00:00:00 2001 From: yemkareems Date: Mon, 29 Jul 2024 18:16:00 +0530 Subject: [PATCH] fix: user_id made required argument and documentation updated accordingly Signed-off-by: yemkareems --- apps/files/lib/Command/ListFiles.php | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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; }