1<?php 2 3declare(strict_types=1); 4 5use dokuwiki\Extension\CLIPlugin; 6use dokuwiki\plugin\dx\src\Standardize; 7use splitbrain\phpcli\Options; 8 9final class cli_plugin_dx extends CLIPlugin 10{ 11 12 protected function setup(Options $options): void 13 { 14 $options->setHelp('An opinionated plugin to improve the Developer Experience of DokuWiki plugin developers'); 15 16 $options->registerCommand('standardize', 'Standardize the dev files of a plugin'); 17 $options->registerArgument('plugin', 'plugin name', true, 'standardize'); 18// $options->registerOption('version', 'print version', 'v'); 19 } 20 21 protected function main(Options $options): void 22 { 23 if ($options->getCmd() !== 'standardize') { 24 return; 25 } 26 $arguments = $options->getArgs(); 27 28 foreach ( $arguments as $pluginName ) { 29 (new Standardize())->standardizePlugin($pluginName); 30 } 31 } 32} 33