diff options
author | yemkareems <yemkareems@gmail.com> | 2024-07-29 18:16:00 +0530 |
---|---|---|
committer | yemkareems <yemkareems@gmail.com> | 2024-07-30 10:01:15 +0530 |
commit | 2dd5854d0958203f660328fdb3c2a6b3f9c362e0 (patch) | |
tree | 9577bda87398f5216d1603914e809ebd041d0749 | |
parent | 49cac414c01e497f9006ab525dbc53562ddea029 (diff) | |
download | nextcloud-server-feature/files-list-occ-command.tar.gz nextcloud-server-feature/files-list-occ-command.zip |
fix: user_id made required argument and documentation updated accordinglyfeature/files-list-occ-command
Signed-off-by: yemkareems <yemkareems@gmail.com>
-rw-r--r-- | apps/files/lib/Command/ListFiles.php | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/apps/files/lib/Command/ListFiles.php b/apps/files/lib/Command/ListFiles.php index e36aae40279..1a96d7a6322 100644 --- a/apps/files/lib/Command/ListFiles.php +++ b/apps/files/lib/Command/ListFiles.php @@ -42,11 +42,11 @@ class ListFiles extends Base { 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 @@ class ListFiles extends Base { 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 @@ class ListFiles extends Base { $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 @@ class ListFiles extends Base { return self::FAILURE; } - $this->presentStats($input, $output); return self::SUCCESS; } |