mirror of
https://github.com/verdigado/organization_folders.git
synced 2024-12-06 11:22:41 +01:00
improved occ command names
This commit is contained in:
parent
4dad10d23f
commit
dc10742476
14 changed files with 22 additions and 22 deletions
34
lib/Command/OrganizationFolder/DeleteOrganizationFolder.php
Normal file
34
lib/Command/OrganizationFolder/DeleteOrganizationFolder.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace OCA\OrganizationFolders\Command\OrganizationFolder;
|
||||
|
||||
use OCP\DB\Exception;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
use OCA\OrganizationFolders\Command\BaseCommand;
|
||||
|
||||
class DeleteOrganizationFolder extends BaseCommand {
|
||||
protected function configure(): void {
|
||||
$this
|
||||
->setName('organization-folders:delete')
|
||||
->setDescription('Delete an organization folder')
|
||||
->addArgument('id', InputArgument::REQUIRED, 'Id of the organization folder to remove');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
$id = (int)$input->getArgument('id');
|
||||
|
||||
try {
|
||||
$this->organizationFolderService->remove($id);
|
||||
|
||||
$output->writeln("done");
|
||||
|
||||
return 0;
|
||||
} catch (Exception $e) {
|
||||
$output->writeln("<error>Exception \"{$e->getMessage()}\" at {$e->getFile()} line {$e->getLine()}</error>");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue