Skip to content

Commit 29fcd9e

Browse files
committed
Added no-backup command to document generator command line tool
fixed option name and type
1 parent 5803418 commit 29fcd9e

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/Doctrine/ODM/MongoDB/Tools/Console/Command/GenerateDocumentsCommand.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ protected function configure()
7676
new InputOption(
7777
'num-spaces', null, InputOption::VALUE_OPTIONAL,
7878
'Defines the number of indentation spaces.', 4
79+
),
80+
new InputOption(
81+
'no-backup', null, InputOption::VALUE_NONE,
82+
'Flag to define if the generator should provide a backup file of exisiting code.'
7983
)
8084
))
8185
->setHelp(<<<EOT
@@ -135,6 +139,7 @@ protected function execute(Console\Input\InputInterface $input, Console\Output\O
135139
$documentGenerator->setGenerateStubMethods($input->getOption('generate-methods'));
136140
$documentGenerator->setRegenerateDocumentIfExists($input->getOption('regenerate-documents'));
137141
$documentGenerator->setUpdateDocumentIfExists($input->getOption('update-documents'));
142+
$documentGenerator->setBackupExisting(!$input->getOption('no-backup'));
138143
$documentGenerator->setNumSpaces($input->getOption('num-spaces'));
139144

140145
if (($extend = $input->getOption('extend')) !== null) {

0 commit comments

Comments
 (0)