@@ -135,13 +135,22 @@ protected function configure(): void
135135 }
136136
137137 foreach ($ options as $ name => $ option ) {
138- $ this ->addOption (
139- name: $ name ,
140- shortcut: $ option ['shortcut ' ],
141- mode: $ option ['mode ' ],
142- description: $ option ['description ' ],
143- default: $ option ['default ' ]
144- );
138+ if (array_key_exists ('default ' , $ option )) {
139+ $ this ->addOption (
140+ name: $ name ,
141+ shortcut: $ option ['shortcut ' ],
142+ mode: $ option ['mode ' ],
143+ description: $ option ['description ' ],
144+ default: $ option ['default ' ]
145+ );
146+ } else {
147+ $ this ->addOption (
148+ name: $ name ,
149+ shortcut: $ option ['shortcut ' ],
150+ mode: $ option ['mode ' ],
151+ description: $ option ['description ' ]
152+ );
153+ }
145154 }
146155 }
147156
@@ -171,7 +180,6 @@ protected function execute(InputInterface $input, OutputInterface $output): int
171180 }
172181
173182 $ configPathRoot = $ this ->rootDir .'/ ' .$ opts ['config-file ' ];
174- $ configPathVendor = $ this ->rootRosterDir .'/ ' .$ opts ['config-file ' ];
175183
176184 if (!is_file ($ configPathRoot )) {
177185 ConfigBag::setRosterConfig (new Config ("{} " , new Json (), true ));
@@ -234,11 +242,11 @@ protected function execute(InputInterface $input, OutputInterface $output): int
234242 ConfigBag::getRosterConfig ()->set ('templates ' , 'doc-templates/roster-templates ' );
235243 }
236244
237- if (isset ( $ opts ['prefer-source ' ]) || !ConfigBag::getRosterConfig ()->has ('prefer-source ' )) {
245+ if ($ opts ['prefer-source ' ] || !ConfigBag::getRosterConfig ()->has ('prefer-source ' )) {
238246 ConfigBag::getRosterConfig ()->set ('prefer-source ' , $ opts ['prefer-source ' ] ?? false );
239247 }
240248
241- if (isset ( $ opts ['mkdocs ' ]) && !ConfigBag::getRosterConfig ()->has ('mkdocs ' )) {
249+ if ($ opts ['mkdocs ' ] && !ConfigBag::getRosterConfig ()->has ('mkdocs ' )) {
242250 ConfigBag::getRosterConfig ()->set ('mkdocs ' , []);
243251 }
244252
@@ -562,7 +570,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
562570
563571 $ oldConfig ->set ('site_name ' , ConfigBag::getRosterConfig ()->get ('mkdocs.site-name ' , $ oldConfig ->get ('site_name ' )));
564572 $ oldConfig ->set ('site_url ' , ConfigBag::getRosterConfig ()->get ('mkdocs.site-url ' , $ oldConfig ->get ('site_url ' )));
565- $ oldConfig ->set ('repo_url ' , ConfigBag::getRosterConfig ()->get ('mkdocs.site- repo ' , $ oldConfig ->get ('repo_url ' )));
573+ $ oldConfig ->set ('repo_url ' , ConfigBag::getRosterConfig ()->get ('mkdocs.repo-url ' , $ oldConfig ->get ('repo_url ' )));
566574 $ oldConfig ->set ('nav ' , $ oldNav );
567575 $ oldConfig ->set ('extra_css ' , $ extraCss );
568576 $ mkDocsConfig = (new YamlDumper (4 ))->dump ($ oldConfig ->all (), 50 , 0 , Yaml::DUMP_OBJECT_AS_MAP );
@@ -585,7 +593,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
585593
586594 $ configBase ->set ('site_name ' , ConfigBag::getRosterConfig ()->get ('mkdocs.site-name ' ));
587595 $ configBase ->set ('site_url ' , ConfigBag::getRosterConfig ()->get ('mkdocs.site-url ' ));
588- $ configBase ->set ('repo_url ' , ConfigBag::getRosterConfig ()->get ('mkdocs.site- repo ' ));
596+ $ configBase ->set ('repo_url ' , ConfigBag::getRosterConfig ()->get ('mkdocs.repo-url ' ));
589597 $ configBase ->set ('nav ' , $ formattedNav );
590598 $ configBase ->set ('extra_css ' , $ extraCss );
591599
0 commit comments