Skip to content

Commit

Permalink
fix: user_id made required argument and documentation updated accordi…
Browse files Browse the repository at this point in the history
…ngly

Signed-off-by: yemkareems <yemkareems@gmail.com>
  • Loading branch information
yemkareems committed Jul 29, 2024
1 parent be1f059 commit 56d36cf
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions apps/files/lib/Command/ListFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -153,20 +153,17 @@ 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)"
);
$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")
Expand All @@ -179,7 +176,6 @@ protected function execute(
return self::FAILURE;
}


$this->presentStats($input, $output);
return self::SUCCESS;
}
Expand Down

0 comments on commit 56d36cf

Please sign in to comment.