Skip to content

Commit

Permalink
comment as optional argument instead of option
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl committed Nov 19, 2021
1 parent 5b9d357 commit 9a687b3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/Command/PointCreate.php
Expand Up @@ -42,6 +42,7 @@
use OCA\Backup\Service\PointService;
use OCP\Files\NotFoundException;
use OCP\Files\NotPermittedException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -83,9 +84,9 @@ protected function configure() {
parent::configure();

$this->setName('backup:point:create')
->setDescription('Generate a restoring point of the instance (complete or differential)')
->addOption('comment', '', InputOption::VALUE_REQUIRED, 'set a comment to the restoring point', '')
->addOption('differential', '', InputOption::VALUE_NONE, 'create a differential restoring point');
->setDescription('Generate a restoring point of the instance (complete or incremental)')
->addArgument('comment', InputArgument::OPTIONAL, 'set a comment to the restoring point', '')
->addOption('differential', '', InputOption::VALUE_NONE, 'create an differential restoring point');
}


Expand All @@ -110,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
$this->outputService->setOutput($output);
}

$point = $this->pointService->create(!$input->getOption('differential'), $input->getOption('comment'));
$point = $this->pointService->create(!$input->getOption('differential'), $input->getArgument('comment'));

if ($o === 'none') {
return 0;
Expand Down

0 comments on commit 9a687b3

Please sign in to comment.