mirror of
https://github.com/nextcloud/server.git
synced 2026-02-20 00:12:30 -05:00
Merge pull request #57731 from hmt/patch-1
Calendar: Fix typos in import/export
This commit is contained in:
commit
93c254f451
2 changed files with 9 additions and 9 deletions
|
|
@ -43,9 +43,9 @@ class ExportCalendar extends Command {
|
|||
$this->setName('calendar:export')
|
||||
->setDescription('Export calendar data from supported calendars to disk or stdout')
|
||||
->addArgument('uid', InputArgument::REQUIRED, 'Id of system user')
|
||||
->addArgument('uri', InputArgument::REQUIRED, 'Uri of calendar')
|
||||
->addArgument('uri', InputArgument::REQUIRED, 'URI of calendar')
|
||||
->addOption('format', null, InputOption::VALUE_REQUIRED, 'Format of output (ical, jcal, xcal) defaults to ical', 'ical')
|
||||
->addOption('location', null, InputOption::VALUE_REQUIRED, 'Location of where to write the output. defaults to stdout');
|
||||
->addOption('location', null, InputOption::VALUE_REQUIRED, 'Location of where to write the output. Defaults to stdout');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int {
|
||||
|
|
@ -73,11 +73,11 @@ class ExportCalendar extends Command {
|
|||
throw new InvalidArgumentException("Format <$format> is not valid.");
|
||||
}
|
||||
$options->setFormat($format);
|
||||
// evaluate is a valid location was given and is usable otherwise output to stdout
|
||||
// evaluate if a valid location was given and is usable otherwise output to stdout
|
||||
if ($location !== null) {
|
||||
$handle = fopen($location, 'wb');
|
||||
if ($handle === false) {
|
||||
throw new InvalidArgumentException("Location <$location> is not valid. Can not open location for write operation.");
|
||||
throw new InvalidArgumentException("Location <$location> is not valid. Cannot open location for write operation.");
|
||||
}
|
||||
|
||||
foreach ($this->exportService->export($calendar, $options) as $chunk) {
|
||||
|
|
|
|||
|
|
@ -45,11 +45,11 @@ class ImportCalendar extends Command {
|
|||
$this->setName('calendar:import')
|
||||
->setDescription('Import calendar data to supported calendars from disk or stdin')
|
||||
->addArgument('uid', InputArgument::REQUIRED, 'Id of system user')
|
||||
->addArgument('uri', InputArgument::REQUIRED, 'Uri of calendar')
|
||||
->addArgument('uri', InputArgument::REQUIRED, 'URI of calendar')
|
||||
->addArgument('location', InputArgument::OPTIONAL, 'Location to read the input from, defaults to stdin.')
|
||||
->addOption('format', null, InputOption::VALUE_REQUIRED, 'Format of input (ical, jcal, xcal) defaults to ical', 'ical')
|
||||
->addOption('errors', null, InputOption::VALUE_REQUIRED, 'how to handel item errors (0 - continue, 1 - fail)')
|
||||
->addOption('validation', null, InputOption::VALUE_REQUIRED, 'how to handel item validation (0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue)')
|
||||
->addOption('errors', null, InputOption::VALUE_REQUIRED, 'how to handle item errors (0 - continue, 1 - fail)')
|
||||
->addOption('validation', null, InputOption::VALUE_REQUIRED, 'how to handle item validation (0 - no validation, 1 - validate and skip on issue, 2 - validate and fail on issue)')
|
||||
->addOption('supersede', null, InputOption::VALUE_NONE, 'override/replace existing items')
|
||||
->addOption('show-created', null, InputOption::VALUE_NONE, 'show all created items after processing')
|
||||
->addOption('show-updated', null, InputOption::VALUE_NONE, 'show all updated items after processing')
|
||||
|
|
@ -103,7 +103,7 @@ class ImportCalendar extends Command {
|
|||
if ($location !== null) {
|
||||
$input = fopen($location, 'r');
|
||||
if ($input === false) {
|
||||
throw new InvalidArgumentException("Location <$location> is not valid. Can not open location for read operation.");
|
||||
throw new InvalidArgumentException("Location <$location> is not valid. Cannot open location for read operation.");
|
||||
}
|
||||
try {
|
||||
$outcome = $this->importService->import($input, $calendar, $options);
|
||||
|
|
@ -113,7 +113,7 @@ class ImportCalendar extends Command {
|
|||
} else {
|
||||
$input = fopen('php://stdin', 'r');
|
||||
if ($input === false) {
|
||||
throw new InvalidArgumentException('Can not open stdin for read operation.');
|
||||
throw new InvalidArgumentException('Cannot open stdin for read operation.');
|
||||
}
|
||||
try {
|
||||
$tempPath = $this->tempManager->getTemporaryFile();
|
||||
|
|
|
|||
Loading…
Reference in a new issue