Permalink
Browse files

[TASK] Added help texts to most commands.

  • Loading branch information...
1 parent dde63e3 commit 2805f0409d23175fe2785e464762257dd5f09e8c @cmuench cmuench committed Oct 16, 2013
Showing with 420 additions and 21 deletions.
  1. +5 −0 changes.txt
  2. BIN n98-magerun.phar
  3. +1 −1 res/twig/dev/module/create/app/etc/modules/readme.twig
  4. +10 −0 src/N98/Magento/Command/Cache/CleanCommand.php
  5. +8 −0 src/N98/Magento/Command/Config/AbstractConfigCommand.php
  6. +22 −0 src/N98/Magento/Command/Config/DumpCommand.php
  7. +5 −8 src/N98/Magento/Command/Config/GetCommand.php
  8. +7 −0 src/N98/Magento/Command/Config/SetCommand.php
  9. +6 −0 src/N98/Magento/Command/Customer/ChangePasswordCommand.php
  10. +1 −1 src/N98/Magento/Command/Customer/CreateCommand.php
  11. +1 −1 src/N98/Magento/Command/Customer/CreateDummyCommand.php
  12. +1 −1 src/N98/Magento/Command/Customer/InfoCommand.php
  13. +7 −0 src/N98/Magento/Command/Customer/ListCommand.php
  14. +7 −0 src/N98/Magento/Command/Database/CreateCommand.php
  15. +7 −0 src/N98/Magento/Command/Database/DropCommand.php
  16. +43 −0 src/N98/Magento/Command/Database/DumpCommand.php
  17. +7 −0 src/N98/Magento/Command/Database/ImportCommand.php
  18. +7 −0 src/N98/Magento/Command/Database/InfoCommand.php
  19. +12 −0 src/N98/Magento/Command/Database/QueryCommand.php
  20. +8 −0 src/N98/Magento/Command/Developer/Module/Rewrite/ConflictsCommand.php
  21. +6 −1 src/N98/Magento/Command/Developer/Theme/DuplicatesCommand.php
  22. +5 −0 src/N98/Magento/Command/Indexer/ListCommand.php
  23. +2 −0 src/N98/Magento/Command/Indexer/ReindexAllCommand.php
  24. +17 −0 src/N98/Magento/Command/Indexer/ReindexCommand.php
  25. +16 −0 src/N98/Magento/Command/Installer/InstallCommand.php
  26. +5 −0 src/N98/Magento/Command/Installer/UninstallCommand.php
  27. +9 −0 src/N98/Magento/Command/LocalConfig/GenerateCommand.php
  28. +6 −0 src/N98/Magento/Command/MagentoConnect/DownloadExtensionCommand.php
  29. +9 −0 src/N98/Magento/Command/MagentoConnect/InstallExtensionCommand.php
  30. +6 −0 src/N98/Magento/Command/MagentoConnect/ListExtensionsCommand.php
  31. +6 −0 src/N98/Magento/Command/MagentoConnect/UpgradeExtensionCommand.php
  32. +14 −0 src/N98/Magento/Command/Script/Repository/ListCommand.php
  33. +64 −0 src/N98/Magento/Command/ScriptCommand.php
  34. +8 −0 src/N98/Magento/Command/System/CheckCommand.php
  35. +1 −1 src/N98/Magento/Command/System/Cron/HistoryCommand.php
  36. +5 −0 src/N98/Magento/Command/System/Cron/RunCommand.php
  37. +4 −0 src/N98/Magento/Command/System/Setup/CompareVersionsCommand.php
  38. +5 −0 src/N98/Magento/Command/System/Setup/RunCommand.php
  39. +15 −0 src/N98/Magento/Command/System/Url/ListCommand.php
  40. +52 −7 src/N98/Util/Template/Twig.php
View
@@ -9,6 +9,11 @@ RECENT CHANGES
* Support for modules inside the vendor folder if app is not in phar mode
* db:dump - Added two new table group for strip option (idx, ee_changelog)
* Fixed problem with installer and target path "."
+* Added twig debug extension
+* dev:module:create command -> Replaced hard coded year with a dynamic version.
+* Added cast_to_array twig filter
+* Added help texts for most commands
+* #228 - Command "config:delete" does not support wildcard *
======
1.79.0
View
Binary file not shown.
@@ -58,4 +58,4 @@ Licence
Copyright
---------
-(c) 2012 {{ vendorNamespace }}
+(c) {{ "now"|date("Y") }} {{ vendorNamespace }}
@@ -17,6 +17,16 @@ protected function configure()
->addArgument('type', InputArgument::OPTIONAL, 'Cache type code like "config"')
->setDescription('Clean magento cache')
;
+
+ $help = <<<HELP
+Cleans expired cache entries.
+If you like to remove all entries use `cache:flush`
+Or only one cache type like i.e. full_page cache:
+
+ $ n98-magerun.phar cache:clean full_page
+
+HELP;
+ $this->setHelp($help);
}
public function isEnabled()
@@ -16,6 +16,14 @@ protected function getEncryptionModel()
}
/**
+ * @return \Mage_Core_Model_Abstract
+ */
+ protected function _getConfigDataModel()
+ {
+ return $this->_getModel('core/config_data', 'Mage_Core_Model_Config_Data');
+ }
+
+ /**
* @param string $value
* @param boolean $decryptionRequired
* @return string
@@ -16,6 +16,28 @@ protected function configure()
->addArgument('xpath', InputArgument::OPTIONAL, 'XPath to filter XML output', null)
->setDescription('Dump merged xml config')
;
+
+ $help = <<<HELP
+Dumps merged XML configuration to stdout. Useful to see all the XML.
+You can filter the XML with first argument.
+
+Examples:
+
+ Config of catalog module
+
+ $ n98-magerun.phar config:dump global/catalog
+
+ See module order in XML
+
+ $ n98-magerun.phar config:dump modules
+
+ Write output to file
+
+ $ n98-magerun.phar config:dump > extern_file.xml
+
+HELP;
+ $this->setHelp($help);
+
}
/**
@@ -31,14 +31,11 @@ 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')
;
- }
- /**
- * @return \Mage_Core_Model_Abstract
- */
- protected function _getConfigDataModel()
- {
- return $this->_getModel('core/config_data', 'Mage_Core_Model_Config_Data');
+ $help = <<<HELP
+If path is not set, all available config items will be listed. path may contain wildcards (*)
+HELP;
+ $this->setHelp($help);
}
/**
@@ -54,7 +51,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$collection = $this->_getConfigDataModel()->getCollection();
$searchPath = $input->getArgument('path');
- if(substr($input->getArgument('path'), -1, 1) === '/') {
+ if (substr($input->getArgument('path'), -1, 1) === '/') {
$searchPath .= '*';
}
@@ -29,6 +29,13 @@ protected function configure()
->addOption('scope-id', null, InputOption::VALUE_OPTIONAL, 'The config value\'s scope ID', '0')
->addOption('encrypt', null, InputOption::VALUE_NONE, 'The config value should be encrypted using local.xml\'s crypt key')
;
+
+ $help = <<<HELP
+Set a store config value by path.
+To set a value of a specify store view you must set the "scope" and "scope-id" option.
+
+HELP;
+ $this->setHelp($help);
}
/**
@@ -18,6 +18,12 @@ protected function configure()
->addArgument('website', InputArgument::OPTIONAL, 'Website of the customer')
->setDescription('Changes the password of a customer.')
;
+
+ $help = <<<HELP
+- Website parameter must only be given if more than one websites are available.
+HELP;
+ $this->setHelp($help);
+
}
/**
@@ -18,7 +18,7 @@ protected function configure()
->addArgument('firstname', InputArgument::OPTIONAL, 'Firstname')
->addArgument('lastname', InputArgument::OPTIONAL, 'Lastname')
->addArgument('website', InputArgument::OPTIONAL, 'Website')
- ->setDescription('Creates a customer.')
+ ->setDescription('Creates a new customer/user for shop frontend.')
;
}
@@ -36,7 +36,7 @@ protected function configure()
->addArgument('count', InputArgument::REQUIRED, 'Count')
->addArgument('locale', InputArgument::REQUIRED, 'Locale')
->addArgument('website', InputArgument::OPTIONAL, 'Website')
- ->setDescription('Creates a dummy customers.')
+ ->setDescription('Generate dummy customers. You can specify a count and a locale.')
->setHelp($help)
;
}
@@ -22,7 +22,7 @@ protected function configure()
->setName('customer:info')
->addArgument('email', InputArgument::OPTIONAL, 'Email')
->addArgument('website', InputArgument::OPTIONAL, 'Website of the customer')
- ->setDescription('Show infos about a customer');
+ ->setDescription('Loads basic customer info by email address.');
}
/**
@@ -16,6 +16,13 @@ protected function configure()
->addArgument('search', InputArgument::OPTIONAL, 'Search query')
->setDescription('Lists customers')
;
+
+ $help = <<<HELP
+List customers. The output is limited to 1000 (can be changed by overriding config).
+If search parameter is given the customers are filtered (searchs in firstname, lastname and email).
+HELP;
+ $this->setHelp($help);
+
}
/**
@@ -15,6 +15,13 @@ protected function configure()
->setName('db:create')
->setDescription('Create currently configured database')
;
+
+ $help = <<<HELP
+The command tries to create the configured database according to your
+settings in app/etc/local.xml.
+The configured user must have "CREATE DATABASE" privileges on MySQL Server.
+HELP;
+ $this->setHelp($help);
}
/**
@@ -16,6 +16,13 @@ protected function configure()
->addOption('force', 'f', InputOption::VALUE_NONE, 'Force')
->setDescription('Drop current database')
;
+
+ $help = <<<HELP
+The command prompts before dropping the database. If --force option is specified it
+directly drops the database.
+The configured user in app/etc/local.xml must have "DROP" privileges.
+HELP;
+ $this->setHelp($help);
}
/**
@@ -36,6 +36,49 @@ protected function configure()
->addOption('strip', 's', InputOption::VALUE_OPTIONAL, 'Tables to strip (dump only structure of those tables)')
->addOption('force', 'f', InputOption::VALUE_NONE, 'Do not prompt if all options are defined')
->setDescription('Dumps database with mysqldump cli client according to informations from local.xml');
+
+ $help = <<<HELP
+Dumps configured magento database with `mysqldump`.
+You must have installed the MySQL client tools.
+
+On debian systems run `apt-get install mysql-client` to do that.
+
+The command reads app/etc/local.xml to find the correct settings.
+If you like to skip data of some tables you can use the --strip option.
+The strip option creates only the structure of the defined tables and
+forces `mysqldump` to skip the data.
+
+Dumps your database and excludes some tables. This is useful i.e. for development.
+
+Separate each table to strip by a space.
+You can use wildcards like * and ? in the table names to strip multiple tables.
+In addition you can specify pre-defined table groups, that start with an @
+Example: "dataflow_batch_export unimportant_module_* @log
+
+ $ n98-magerun.phar db:dump --strip="@stripped"
+
+Available Table Groups:
+
+* @log Log tables
+* @dataflowtemp Temporary tables of the dataflow import/export tool
+* @stripped Standard definition for a stripped dump (logs and dataflow)
+* @sales Sales data (orders, invoices, creditmemos etc)
+* @customers Customer data
+* @trade Current trade data (customers and orders). You usally do not want those in developer systems.
+* @development Removes logs and trade data so developers do not have to work with real customer data
+
+Extended: https://github.com/netz98/n98-magerun/wiki/Stripped-Database-Dumps
+
+See it in action: http://youtu.be/ttjZHY6vThs
+
+- If you like to prepend a timestamp to the dump name the --add-time option can be used.
+
+- The command comes with a compression function. Add i.e. `--compress=gz` to dump directly in
+ gzip compressed file.
+
+HELP;
+ $this->setHelp($help);
+
}
/**
@@ -18,6 +18,13 @@ protected function configure()
->addOption('only-command', null, InputOption::VALUE_NONE, 'Print only mysql command. Do not execute')
->addOption('only-if-empty', null, InputOption::VALUE_NONE, 'Imports only if database is empty')
->setDescription('Imports database with mysql cli client according to database defined in local.xml');
+
+ $help = <<<HELP
+Imports an SQL file with mysql cli client into current configured database.
+
+You need to have MySQL client tools installed on your system.
+HELP;
+
}
/**
@@ -16,6 +16,13 @@ protected function configure()
->addDeprecatedAlias('database:info', 'Please use db:info')
->setDescription('Dumps database informations')
;
+
+ $help = <<<HELP
+This command is useful to print all informations about the current configured database in app/etc/local.xml.
+It can print connection string for JDBC, PDO connections.
+HELP;
+ $this->setHelp($help);
+
}
/**
@@ -17,6 +17,18 @@ 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 = <<<HELP
+Executes an SQL query on the current configured database. Wrap your SQL in
+single or double quotes.
+
+If your query produces a result (e.g. a SELECT statement), the output of the
+mysql cli tool will be returned.
+
+* Requires MySQL CLI tools installed on your system.
+
+HELP;
+ $this->setHelp($help);
}
/**
@@ -18,6 +18,14 @@ protected function configure()
->addOption('log-junit', null, InputOption::VALUE_REQUIRED, 'Log conflicts in JUnit XML format to defined file.')
->setDescription('Lists all magento rewrite conflicts')
;
+
+ $help = <<<HELP
+Lists all duplicated rewrites and tells you which class is loaded by Magento.
+The command checks class inheritance in order of your module dependencies.
+
+* If a filename with `--log-junit` option is set the tool generates an XML file and no output to *stdout*.
+HELP;
+ $this->setHelp($help);
}
/**
@@ -24,8 +24,13 @@ protected function configure()
'base/default'
)
->addOption('log-junit', null, InputOption::VALUE_REQUIRED, 'Log duplicates in JUnit XML format to defined file.')
- ->setDescription('Find duplicate files in your theme')
+ ->setDescription('Find duplicate files (templates, layout, locale, etc.) between two themes.')
;
+
+ $help = <<<HELP
+* If a filename with `--log-junit` option is set the tool generates an XML file and no output to *stdout*.
+HELP;
+ $this->setHelp($help);
}
/**
@@ -15,6 +15,11 @@ protected function configure()
->setName('index:list')
->setDescription('Lists all magento indexes')
;
+
+ $help = <<<HELP
+Lists all Magento indexers of current installation.
+HELP;
+
}
/**
@@ -15,6 +15,8 @@ protected function configure()
->setName('index:reindex:all')
->setDescription('Reindex all magento indexes')
;
+
+ $this->setHelp('Loops all magento indexes and triggers reindex.');
}
/**
@@ -16,6 +16,23 @@ protected function configure()
->addArgument('index_code', InputArgument::OPTIONAL, 'Code of indexer.')
->setDescription('Reindex a magento index by code')
;
+
+ $help = <<<HELP
+Index by indexer code. Code is optional. If you don't specify a code you can pick a indexer from a list.
+
+ $ n98-magerun.phar index:reindex [code]
+
+
+Since 1.75.0 it's possible to run mutiple indexers by seperating code with a comma.
+
+i.e.
+
+ $ n98-magerun.phar index:reindex catalog_product_attribute,tag_summary
+
+If no index is provided as argument you can select indexers from menu by "number" like "1,3" for first and third
+indexer.
+HELP;
+ $this->setHelp($help);
}
/**
@@ -51,6 +51,22 @@ protected function configure()
->setDescription('Install magento')
;
+ $help = <<<HELP
+* Download Magento by a list of git repos and zip files (mageplus, magelte, official community packages).
+* Try to create database if it does not exist.
+* Installs Magento sample data if available (since version 1.2.0).
+* Starts Magento installer
+* Sets rewrite base in .htaccess file
+
+Example of an unattended Magento CE 1.7.0.2 installation:
+
+ $ n98-magerun.phar install --dbHost="localhost" --dbUser="mydbuser" --dbPass="mysecret" --dbName="magentodb" --installSampleData=yes --useDefaultConfigParams=yes --magentoVersionByName="magento-ce-1.7.0.2" --installationFolder="magento" --baseUrl="http://magento.localdomain/"
+
+See it in action: http://youtu.be/WU-CbJ86eQc
+
+HELP;
+ $this->setHelp($help);
+
$this->notEmptyCallback = function($input)
{
if (empty($input)) {
Oops, something went wrong.

0 comments on commit 2805f04

Please sign in to comment.