From 85a3b8849cae44d3702889d1537d28917cdfcd70 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Sun, 14 Jul 2024 05:31:06 +0200 Subject: [PATCH] Moved help from commands `configure()` to `getHelp()` --- .../Magento/Command/Cache/CleanCommand.php | 9 +++- .../Magento/Command/Cache/FlushCommand.php | 9 +++- .../Magento/Command/Config/DeleteCommand.php | 9 +++- .../Magento/Command/Config/DumpCommand.php | 9 +++- src/N98/Magento/Command/Config/GetCommand.php | 28 +++++------ .../Magento/Command/Config/SearchCommand.php | 15 ++++-- src/N98/Magento/Command/Config/SetCommand.php | 10 ++-- .../Customer/ChangePasswordCommand.php | 11 +++-- .../Command/Customer/CreateDummyCommand.php | 39 ++++++++------- .../Command/Customer/DeleteCommand.php | 11 +++-- .../Magento/Command/Customer/ListCommand.php | 9 +++- .../Command/Database/CreateCommand.php | 9 +++- .../Magento/Command/Database/DropCommand.php | 9 +++- .../Magento/Command/Database/DumpCommand.php | 21 +++++---- .../Command/Database/ImportCommand.php | 9 +++- .../Magento/Command/Database/InfoCommand.php | 9 +++- .../Database/Maintain/CheckTablesCommand.php | 47 ++++++++++--------- .../Magento/Command/Database/QueryCommand.php | 10 ++-- .../Command/Database/StatusCommand.php | 9 +++- .../Command/Database/VariablesCommand.php | 9 +++- .../Module/Rewrite/ConflictsCommand.php | 9 +++- .../Developer/Theme/DuplicatesCommand.php | 9 +++- .../Eav/Attribute/Create/DummyCommand.php | 21 ++++++--- .../Magento/Command/Indexer/ListCommand.php | 9 +++- .../Command/Indexer/ListMviewCommand.php | 9 +++- .../Command/Indexer/ReindexAllCommand.php | 10 +++- .../Command/Indexer/ReindexCommand.php | 9 +++- .../Command/Indexer/ReindexMviewCommand.php | 9 +++- .../Command/Installer/InstallCommand.php | 12 +++-- .../Command/Installer/UninstallCommand.php | 9 +++- .../Command/LocalConfig/GenerateCommand.php | 9 +++- .../Command/Script/Repository/ListCommand.php | 9 +++- .../Command/Script/Repository/RunCommand.php | 25 ++++++---- src/N98/Magento/Command/ScriptCommand.php | 9 +++- src/N98/Magento/Command/SelfUpdateCommand.php | 21 +++++---- .../Magento/Command/System/CheckCommand.php | 9 +++- .../Command/System/Cron/RunCommand.php | 12 +++-- .../System/Setup/CompareVersionsCommand.php | 10 +++- .../System/Setup/IncrementalCommand.php | 17 +++++-- .../Command/System/Setup/RunCommand.php | 10 +++- .../Command/System/Url/ListCommand.php | 9 +++- 41 files changed, 369 insertions(+), 168 deletions(-) diff --git a/src/N98/Magento/Command/Cache/CleanCommand.php b/src/N98/Magento/Command/Cache/CleanCommand.php index 0fd03d32f..94e659483 100644 --- a/src/N98/Magento/Command/Cache/CleanCommand.php +++ b/src/N98/Magento/Command/Cache/CleanCommand.php @@ -30,8 +30,14 @@ protected function configure() ) ->setDescription('Clean magento cache') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Cache/FlushCommand.php b/src/N98/Magento/Command/Cache/FlushCommand.php index c89be2be7..ddf68904b 100644 --- a/src/N98/Magento/Command/Cache/FlushCommand.php +++ b/src/N98/Magento/Command/Cache/FlushCommand.php @@ -29,8 +29,14 @@ protected function configure() ) ->setDescription('Flush magento cache storage') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Config/DeleteCommand.php b/src/N98/Magento/Command/Config/DeleteCommand.php index 360eb0efc..9927f6be4 100644 --- a/src/N98/Magento/Command/Config/DeleteCommand.php +++ b/src/N98/Magento/Command/Config/DeleteCommand.php @@ -33,11 +33,16 @@ protected function configure() ) ->addOption('all', null, InputOption::VALUE_NONE, 'Delete all entries by path') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Config/DumpCommand.php b/src/N98/Magento/Command/Config/DumpCommand.php index d58cb80c2..8ae198268 100644 --- a/src/N98/Magento/Command/Config/DumpCommand.php +++ b/src/N98/Magento/Command/Config/DumpCommand.php @@ -18,8 +18,14 @@ protected function configure() ->addArgument('xpath', InputArgument::OPTIONAL, 'XPath to filter XML output', null) ->setDescription('Dump merged xml config') ; + } - $help = << extern_file.xml HELP; - $this->setHelp($help); } /** diff --git a/src/N98/Magento/Command/Config/GetCommand.php b/src/N98/Magento/Command/Config/GetCommand.php index 8ec70b86b..20c01c16d 100644 --- a/src/N98/Magento/Command/Config/GetCommand.php +++ b/src/N98/Magento/Command/Config/GetCommand.php @@ -17,17 +17,6 @@ protected function configure() $this ->setName('config:get') ->setDescription('Get a core config item') - ->setHelp( - <<path is not set, all available config items will be listed. -The path may contain wildcards (*). -If path ends with a trailing slash, all child items will be listed. E.g. - - config:get web/ -is the same as - config:get web/* -EOT - ) ->addArgument('path', InputArgument::OPTIONAL, 'The config path') ->addOption( 'scope', @@ -45,11 +34,22 @@ protected function configure() ->addOption('update-script', null, InputOption::VALUE_NONE, 'Output as update script lines') ->addOption('magerun-script', null, InputOption::VALUE_NONE, 'Output for usage with config:set') ->addFormatOption(); + } - $help = <<path is not set, all available config items will be listed. +The path may contain wildcards (*). +If path ends with a trailing slash, all child items will be listed. E.g. + + config:get web/ +is the same as + config:get web/* HELP; - $this->setHelp($help); } /** diff --git a/src/N98/Magento/Command/Config/SearchCommand.php b/src/N98/Magento/Command/Config/SearchCommand.php index 760f165a0..61313e9cf 100644 --- a/src/N98/Magento/Command/Config/SearchCommand.php +++ b/src/N98/Magento/Command/Config/SearchCommand.php @@ -16,14 +16,19 @@ protected function configure() $this ->setName('config:search') ->setDescription('Search system configuration descriptions.') - ->setHelp( - << and for the indicated text. -EOT - ) ->addArgument('text', InputArgument::REQUIRED, 'The text to search for'); } + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return << and for the indicated text. +HELP; + } + /** * @param InputInterface $input * @param OutputInterface $output diff --git a/src/N98/Magento/Command/Config/SetCommand.php b/src/N98/Magento/Command/Config/SetCommand.php index 9dac9db47..335abc1ac 100644 --- a/src/N98/Magento/Command/Config/SetCommand.php +++ b/src/N98/Magento/Command/Config/SetCommand.php @@ -44,13 +44,17 @@ protected function configure() "Do not treat value NULL as " . self::DISPLAY_NULL_UNKNOWN_VALUE . " value" ) ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Customer/ChangePasswordCommand.php b/src/N98/Magento/Command/Customer/ChangePasswordCommand.php index 66132e53d..89e6061bf 100644 --- a/src/N98/Magento/Command/Customer/ChangePasswordCommand.php +++ b/src/N98/Magento/Command/Customer/ChangePasswordCommand.php @@ -22,11 +22,16 @@ protected function configure() ->addArgument('website', InputArgument::OPTIONAL, 'Website of the customer') ->setDescription('Changes the password of a customer.') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Customer/CreateDummyCommand.php b/src/N98/Magento/Command/Customer/CreateDummyCommand.php index 5dab97493..8d107bc17 100644 --- a/src/N98/Magento/Command/Customer/CreateDummyCommand.php +++ b/src/N98/Magento/Command/Customer/CreateDummyCommand.php @@ -16,7 +16,28 @@ class CreateDummyCommand extends AbstractCustomerCommand { protected function configure() { - $help = <<setName('customer:create:dummy') + ->addArgument('count', InputArgument::REQUIRED, 'Count') + ->addArgument('locale', InputArgument::REQUIRED, Locale::class) + ->addArgument('website', InputArgument::OPTIONAL, 'Website') + ->addOption( + 'with-addresses', + null, + InputOption::VALUE_NONE, + 'Create dummy billing/shipping addresses for each customers' + ) + ->setDescription('Generate dummy customers. You can specify a count and a locale.') + ->addFormatOption() + ; + } + + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return <<setName('customer:create:dummy') - ->addArgument('count', InputArgument::REQUIRED, 'Count') - ->addArgument('locale', InputArgument::REQUIRED, Locale::class) - ->addArgument('website', InputArgument::OPTIONAL, 'Website') - ->addOption( - 'with-addresses', - null, - InputOption::VALUE_NONE, - 'Create dummy billing/shipping addresses for each customers' - ) - ->setDescription('Generate dummy customers. You can specify a count and a locale.') - ->addFormatOption() - ->setHelp($help) - ; } /** diff --git a/src/N98/Magento/Command/Customer/DeleteCommand.php b/src/N98/Magento/Command/Customer/DeleteCommand.php index 5d6ee4da3..cc3d68aab 100644 --- a/src/N98/Magento/Command/Customer/DeleteCommand.php +++ b/src/N98/Magento/Command/Customer/DeleteCommand.php @@ -49,8 +49,14 @@ protected function configure() ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force delete') ->addOption('range', '-r', InputOption::VALUE_NONE, 'Delete a range of customers by Id') ->setDescription('Delete Customer/s'); + } - $help = <<Example Usage: @@ -59,10 +65,7 @@ protected function configure() n98-magerun customer:delete mike@example.com # Will delete customer with that email n98-magerun customer:delete --all # Will delete all customers n98-magerun customer:delete --range # Will prompt for start and end Ids for batch deletion - HELP; - - $this->setHelp($help); } /** diff --git a/src/N98/Magento/Command/Customer/ListCommand.php b/src/N98/Magento/Command/Customer/ListCommand.php index cc60a8592..2eafea8a9 100644 --- a/src/N98/Magento/Command/Customer/ListCommand.php +++ b/src/N98/Magento/Command/Customer/ListCommand.php @@ -17,12 +17,17 @@ protected function configure() ->addFormatOption() ->setDescription('Lists customers') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/CreateCommand.php b/src/N98/Magento/Command/Database/CreateCommand.php index 3572573ae..9b187e3f9 100644 --- a/src/N98/Magento/Command/Database/CreateCommand.php +++ b/src/N98/Magento/Command/Database/CreateCommand.php @@ -13,13 +13,18 @@ protected function configure() ->setName('db:create') ->setDescription('Create currently configured database') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/DropCommand.php b/src/N98/Magento/Command/Database/DropCommand.php index 469f80bd7..e0d2ddaeb 100644 --- a/src/N98/Magento/Command/Database/DropCommand.php +++ b/src/N98/Magento/Command/Database/DropCommand.php @@ -19,13 +19,18 @@ protected function configure() ->addOption('force', 'f', InputOption::VALUE_NONE, 'Force') ->setDescription('Drop current database') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/DumpCommand.php b/src/N98/Magento/Command/Database/DumpCommand.php index 30958be8e..0628baa50 100644 --- a/src/N98/Magento/Command/Database/DumpCommand.php +++ b/src/N98/Magento/Command/Database/DumpCommand.php @@ -138,7 +138,13 @@ protected function configure() 'Specify local.xml connection node, default to default_setup' ) ->setDescription('Dumps database with mysqldump cli client'); + } + /** + * {@inheritdoc} + */ + public function getHelp(): string + { $help = <<setHelp($help); + return + $help . PHP_EOL + . $this->getCompressionHelp() . PHP_EOL + . $this->getTableDefinitionHelp(); } /** @@ -238,14 +247,6 @@ public function getTableDefinitionHelp() return $messages; } - public function getHelp() - { - return - parent::getHelp() . PHP_EOL - . $this->getCompressionHelp() . PHP_EOL - . $this->getTableDefinitionHelp(); - } - /** * @param InputInterface $input * @param OutputInterface $output diff --git a/src/N98/Magento/Command/Database/ImportCommand.php b/src/N98/Magento/Command/Database/ImportCommand.php index 6efc22e40..84a45509d 100644 --- a/src/N98/Magento/Command/Database/ImportCommand.php +++ b/src/N98/Magento/Command/Database/ImportCommand.php @@ -29,13 +29,18 @@ protected function configure() ->addOption('stdin', null, InputOption::VALUE_NONE, 'Import data from STDIN rather than file') ->addOption('drop-tables', null, InputOption::VALUE_NONE, 'Drop tables before import') ->setDescription('Imports database with mysql cli client according to database defined in local.xml'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/InfoCommand.php b/src/N98/Magento/Command/Database/InfoCommand.php index 0a62720ed..0cf686324 100644 --- a/src/N98/Magento/Command/Database/InfoCommand.php +++ b/src/N98/Magento/Command/Database/InfoCommand.php @@ -20,12 +20,17 @@ protected function configure() ->addFormatOption() ; $this->addDeprecatedAlias('database:info', 'Please use db:info'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php b/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php index 745e1763d..8fce099c5 100644 --- a/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php +++ b/src/N98/Magento/Command/Database/Maintain/CheckTablesCommand.php @@ -44,7 +44,32 @@ class CheckTablesCommand extends AbstractMagentoCommand protected function configure() { - $help = <<<'HELP' + $this + ->setName('db:maintain:check-tables') + ->setDescription('Check database tables') + ->addOption( + 'type', + null, + InputOption::VALUE_OPTIONAL, + 'Check type (one of QUICK, FAST, MEDIUM, EXTENDED, CHANGED)', + 'MEDIUM' + ) + ->addOption('repair', null, InputOption::VALUE_NONE, 'Repair tables (only MyISAM)') + ->addOption( + 'table', + null, + InputOption::VALUE_OPTIONAL, + 'Process only given table (wildcards are supported)' + ) + ->addFormatOption(); + } + + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return <<TYPE OPTIONS QUICK @@ -71,26 +96,6 @@ protected function configure() InnoDB tables will be optimized with the ALTER TABLE ... ENGINE=InnoDB statement. The options above do not apply to them. HELP; - - $this - ->setName('db:maintain:check-tables') - ->setDescription('Check database tables') - ->addOption( - 'type', - null, - InputOption::VALUE_OPTIONAL, - 'Check type (one of QUICK, FAST, MEDIUM, EXTENDED, CHANGED)', - 'MEDIUM' - ) - ->addOption('repair', null, InputOption::VALUE_NONE, 'Repair tables (only MyISAM)') - ->addOption( - 'table', - null, - InputOption::VALUE_OPTIONAL, - 'Process only given table (wildcards are supported)' - ) - ->addFormatOption() - ->setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/QueryCommand.php b/src/N98/Magento/Command/Database/QueryCommand.php index 7583ba6c2..a76838516 100644 --- a/src/N98/Magento/Command/Database/QueryCommand.php +++ b/src/N98/Magento/Command/Database/QueryCommand.php @@ -18,8 +18,14 @@ protected function configure() ->addOption('only-command', null, InputOption::VALUE_NONE, 'Print only mysql command. Do not execute') ->setDescription('Executes an SQL query on the database defined in local.xml') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/StatusCommand.php b/src/N98/Magento/Command/Database/StatusCommand.php index 2e77efe2f..dec02132a 100644 --- a/src/N98/Magento/Command/Database/StatusCommand.php +++ b/src/N98/Magento/Command/Database/StatusCommand.php @@ -30,11 +30,16 @@ protected function configure() $this ->setName('db:status') ->setDescription('Shows important server status information or custom selected status values'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Database/VariablesCommand.php b/src/N98/Magento/Command/Database/VariablesCommand.php index eab485c3b..5f313be81 100644 --- a/src/N98/Magento/Command/Database/VariablesCommand.php +++ b/src/N98/Magento/Command/Database/VariablesCommand.php @@ -22,11 +22,16 @@ protected function configure() $this ->setName('db:variables') ->setDescription('Shows important variables or custom selected'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php b/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php index 15f2260d1..956a3814d 100644 --- a/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php +++ b/src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php @@ -24,8 +24,14 @@ protected function configure() 'Log conflicts in JUnit XML format to defined file.' ) ->setDescription('Lists all magento rewrite conflicts'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php b/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php index 8809a17f7..b61e38427 100644 --- a/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php +++ b/src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php @@ -32,11 +32,16 @@ protected function configure() ) ->setDescription('Find duplicate files (templates, layout, locale, etc.) between two themes.') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php b/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php index 469db9fa9..54b02c2a0 100644 --- a/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php +++ b/src/N98/Magento/Command/Eav/Attribute/Create/DummyCommand.php @@ -21,21 +21,28 @@ class DummyCommand extends AbstractMagentoCommand protected function configure() { - $help = <<setName('eav:attribute:create-dummy-values')->addArgument('locale', InputArgument::OPTIONAL, Locale::class) ->addArgument('attribute-id', InputArgument::OPTIONAL, 'Attribute ID to add values') ->addArgument('values-type', InputArgument::OPTIONAL, 'Types of Values to create (default int)') ->addArgument('values-number', InputArgument::OPTIONAL, 'Number of Values to create (default 1)') - ->setDescription('Create a dummy values for dropdown attributes')->setHelp($help) + ->setDescription('Create a dummy values for dropdown attributes') ; } + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return <<setDescription('Lists all magento indexes') ->addFormatOption() ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Indexer/ListMviewCommand.php b/src/N98/Magento/Command/Indexer/ListMviewCommand.php index 60c10fb58..799745848 100644 --- a/src/N98/Magento/Command/Indexer/ListMviewCommand.php +++ b/src/N98/Magento/Command/Indexer/ListMviewCommand.php @@ -15,11 +15,16 @@ protected function configure() ->setDescription('Lists all magento mview indexes') ->addFormatOption() ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Indexer/ReindexAllCommand.php b/src/N98/Magento/Command/Indexer/ReindexAllCommand.php index 238450b4e..81af22a2e 100644 --- a/src/N98/Magento/Command/Indexer/ReindexAllCommand.php +++ b/src/N98/Magento/Command/Indexer/ReindexAllCommand.php @@ -15,8 +15,16 @@ protected function configure() ->setName('index:reindex:all') ->setDescription('Reindex all magento indexes') ; + } - $this->setHelp('Loops all magento indexes and triggers reindex.'); + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return <<setName('index:reindex') ->addArgument('index_code', InputArgument::OPTIONAL, 'Code of indexer.') ->setDescription('Reindex a magento index by code'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Indexer/ReindexMviewCommand.php b/src/N98/Magento/Command/Indexer/ReindexMviewCommand.php index bfe03b2e3..8dbb5ffd4 100644 --- a/src/N98/Magento/Command/Indexer/ReindexMviewCommand.php +++ b/src/N98/Magento/Command/Indexer/ReindexMviewCommand.php @@ -15,13 +15,18 @@ protected function configure() ->setName('index:reindex:mview') ->addArgument('table_name', InputArgument::REQUIRED, 'View table name"') ->setDescription('Reindex a magento index by code using the materialised view functionality'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Installer/InstallCommand.php b/src/N98/Magento/Command/Installer/InstallCommand.php index 3b772140c..f6890a51c 100644 --- a/src/N98/Magento/Command/Installer/InstallCommand.php +++ b/src/N98/Magento/Command/Installer/InstallCommand.php @@ -83,8 +83,14 @@ protected function configure() 'If --composer-use-same-php-binary passed, will invoke composer with the same PHP binary' ) ->setDescription('Install magento'); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Installer/UninstallCommand.php b/src/N98/Magento/Command/Installer/UninstallCommand.php index b5ee14a8b..b30fb1994 100644 --- a/src/N98/Magento/Command/Installer/UninstallCommand.php +++ b/src/N98/Magento/Command/Installer/UninstallCommand.php @@ -35,11 +35,16 @@ protected function configure() 'Uninstall magento (drops database and empties current folder or folder set via installationFolder)' ) ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/LocalConfig/GenerateCommand.php b/src/N98/Magento/Command/LocalConfig/GenerateCommand.php index 14087f317..7b13cc47d 100644 --- a/src/N98/Magento/Command/LocalConfig/GenerateCommand.php +++ b/src/N98/Magento/Command/LocalConfig/GenerateCommand.php @@ -26,15 +26,20 @@ protected function configure() ->addArgument('admin-frontname', InputArgument::OPTIONAL, 'Admin front name') ->addArgument('encryption-key', InputArgument::OPTIONAL, 'Encryption Key') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/Script/Repository/ListCommand.php b/src/N98/Magento/Command/Script/Repository/ListCommand.php index 5031c842e..a7f04f1df 100644 --- a/src/N98/Magento/Command/Script/Repository/ListCommand.php +++ b/src/N98/Magento/Command/Script/Repository/ListCommand.php @@ -17,8 +17,14 @@ protected function configure() ->setDescription('Lists all scripts in repository') ->addFormatOption() ; + } - $help = <</.n98-magerun/scripts*. @@ -30,7 +36,6 @@ protected function configure() $ n98-magerun.phar script:repo:list HELP; - $this->setHelp($help); } /** diff --git a/src/N98/Magento/Command/Script/Repository/RunCommand.php b/src/N98/Magento/Command/Script/Repository/RunCommand.php index 85f812a87..269ae4ed2 100644 --- a/src/N98/Magento/Command/Script/Repository/RunCommand.php +++ b/src/N98/Magento/Command/Script/Repository/RunCommand.php @@ -15,7 +15,21 @@ class RunCommand extends AbstractRepositoryCommand { protected function configure() { - $help = <<setName('script:repo:run') + ->addArgument('script', InputArgument::OPTIONAL, 'Name of script in repository') + ->addOption('define', 'd', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Defines a variable') + ->addOption('stop-on-error', null, InputOption::VALUE_NONE, 'Stops execution of script on error') + ->setDescription('Run script from repository') + ; + } + + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return << HELP; - - $this - ->setName('script:repo:run') - ->addArgument('script', InputArgument::OPTIONAL, 'Name of script in repository') - ->addOption('define', 'd', InputOption::VALUE_OPTIONAL | InputOption::VALUE_IS_ARRAY, 'Defines a variable') - ->addOption('stop-on-error', null, InputOption::VALUE_NONE, 'Stops execution of script on error') - ->setDescription('Run script from repository') - ->setHelp($help) - ; } protected function execute(InputInterface $input, OutputInterface $output): int diff --git a/src/N98/Magento/Command/ScriptCommand.php b/src/N98/Magento/Command/ScriptCommand.php index ce4aca091..8c0de9c66 100644 --- a/src/N98/Magento/Command/ScriptCommand.php +++ b/src/N98/Magento/Command/ScriptCommand.php @@ -42,8 +42,14 @@ protected function configure() ->addOption('stop-on-error', null, InputOption::VALUE_NONE, 'Stops execution of script on error') ->setDescription('Runs multiple n98-magerun commands') ; + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/SelfUpdateCommand.php b/src/N98/Magento/Command/SelfUpdateCommand.php index 3ae1bc646..81cb8fdfa 100644 --- a/src/N98/Magento/Command/SelfUpdateCommand.php +++ b/src/N98/Magento/Command/SelfUpdateCommand.php @@ -37,16 +37,21 @@ protected function configure() ->setAliases(['selfupdate']) ->addOption('unstable', null, InputOption::VALUE_NONE, 'Load unstable version from develop branch') ->addOption('dry-run', null, InputOption::VALUE_NONE, 'Tests if there is a new version without any update.') - ->setDescription('Updates n98-magerun2.phar to the latest version.') - ->setHelp( - <<self-update command checks github for newer -versions of n98-magerun2 and if found, installs the latest. + ->setDescription('Updates n98-magerun2.phar to the latest version.'); + } + + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return <<self-update command checks GitHub for newer +versions of n98-magerun and if found, installs the latest. -php n98-magerun2.phar self-update +php n98-magerun.phar self-update -EOT - ); +HELP; } /** diff --git a/src/N98/Magento/Command/System/CheckCommand.php b/src/N98/Magento/Command/System/CheckCommand.php index 871f8599e..d99faf132 100644 --- a/src/N98/Magento/Command/System/CheckCommand.php +++ b/src/N98/Magento/Command/System/CheckCommand.php @@ -37,14 +37,19 @@ protected function configure() ->setName('sys:check') ->setDescription('Checks Magento System') ->addFormatOption(); + } - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/System/Cron/RunCommand.php b/src/N98/Magento/Command/System/Cron/RunCommand.php index 28684ca65..294333022 100644 --- a/src/N98/Magento/Command/System/Cron/RunCommand.php +++ b/src/N98/Magento/Command/System/Cron/RunCommand.php @@ -31,12 +31,18 @@ protected function configure() ->addArgument('job', InputArgument::OPTIONAL, 'Job code') ->addOption('schedule', 's', InputOption::VALUE_NONE, 'Schedule cron instead of run with current user') ->setDescription('Runs a cronjob by job code'); - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php b/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php index 9c442f984..659084426 100644 --- a/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php +++ b/src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php @@ -28,10 +28,16 @@ protected function configure() ) ->addFormatOption() ->setDescription('Compare module version with core_resource table.'); - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/System/Setup/IncrementalCommand.php b/src/N98/Magento/Command/System/Setup/IncrementalCommand.php index 5c36195c2..acbad4613 100644 --- a/src/N98/Magento/Command/System/Setup/IncrementalCommand.php +++ b/src/N98/Magento/Command/System/Setup/IncrementalCommand.php @@ -59,11 +59,18 @@ protected function configure() $this ->setName('sys:setup:incremental') ->setDescription('List new setup scripts to run, then runs one script') - ->addOption('stop-on-error', null, InputOption::VALUE_NONE, 'Stops execution of script on error') - ->setHelp( - 'Examines an un-cached configuration tree and determines which ' . - 'structure and data setup resource scripts need to run, and then runs them.' - ); + ->addOption('stop-on-error', null, InputOption::VALUE_NONE, 'Stops execution of script on error'); + } + + /** + * {@inheritdoc} + */ + public function getHelp(): string + { + return <<setDescription('Runs all new setup scripts.'); - $help = <<setHelp($help); } /** diff --git a/src/N98/Magento/Command/System/Url/ListCommand.php b/src/N98/Magento/Command/System/Url/ListCommand.php index 94919d5cc..e335e8a53 100644 --- a/src/N98/Magento/Command/System/Url/ListCommand.php +++ b/src/N98/Magento/Command/System/Url/ListCommand.php @@ -40,8 +40,14 @@ protected function configure() ->addArgument('stores', InputArgument::OPTIONAL, 'Stores (comma-separated list of store ids)') ->addArgument('linetemplate', InputArgument::OPTIONAL, 'Line template', '{url}') ->setDescription('Get all urls.'); + } - $help = <<setHelp($help); } /**