summaryrefslogtreecommitdiffstats
path: root/core/Command/Group
diff options
context:
space:
mode:
Diffstat (limited to 'core/Command/Group')
-rw-r--r--core/Command/Group/Add.php14
1 files changed, 13 insertions, 1 deletions
diff --git a/core/Command/Group/Add.php b/core/Command/Group/Add.php
index 61253cf163d..f2ee6195a44 100644
--- a/core/Command/Group/Add.php
+++ b/core/Command/Group/Add.php
@@ -28,6 +28,7 @@ use OC\Core\Command\Base;
use OCP\IGroupManager;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
+use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
class Add extends Base {
@@ -49,7 +50,13 @@ class Add extends Base {
->addArgument(
'groupid',
InputArgument::REQUIRED,
- 'Group name'
+ 'Group id'
+ )
+ ->addOption(
+ 'display-name',
+ null,
+ InputOption::VALUE_REQUIRED,
+ 'Group name used in the web UI (can contain any characters)'
);
}
@@ -62,6 +69,11 @@ class Add extends Base {
} else {
$group = $this->groupManager->createGroup($gid);
$output->writeln('Created group "' . $group->getGID() . '"');
+
+ $displayName = trim((string) $input->getOption('display-name'));
+ if ($displayName !== '') {
+ $group->setDisplayName($displayName);
+ }
}
}
}