[ticket/14123] Add descriptive help to the CLI help output

PHPBB3-14123
This commit is contained in:
Matt Friedman 2015-08-23 15:14:08 -07:00
parent ef3de412b7
commit 13851f308f
16 changed files with 96 additions and 1 deletions

View file

@ -54,7 +54,7 @@ $lang = array_merge($lang, array(
'CLI_DESCRIPTION_DELETE_CONFIG' => 'Deletes a configuration option', 'CLI_DESCRIPTION_DELETE_CONFIG' => 'Deletes a configuration option',
'CLI_DESCRIPTION_DISABLE_EXTENSION' => 'Disables the specified extension.', 'CLI_DESCRIPTION_DISABLE_EXTENSION' => 'Disables the specified extension.',
'CLI_DESCRIPTION_ENABLE_EXTENSION' => 'Enables the specified extension.', 'CLI_DESCRIPTION_ENABLE_EXTENSION' => 'Enables the specified extension.',
'CLI_DESCRIPTION_FIND_MIGRATIONS' => 'Finds migrations that are not depended on.', 'CLI_DESCRIPTION_FIND_MIGRATIONS' => 'Finds migrations that are not depended upon.',
'CLI_DESCRIPTION_GET_CONFIG' => 'Gets a configuration options value', 'CLI_DESCRIPTION_GET_CONFIG' => 'Gets a configuration options value',
'CLI_DESCRIPTION_INCREMENT_CONFIG' => 'Increments a configuration options value', 'CLI_DESCRIPTION_INCREMENT_CONFIG' => 'Increments a configuration options value',
'CLI_DESCRIPTION_LIST_EXTENSIONS' => 'Lists all extensions in the database and on the filesystem.', 'CLI_DESCRIPTION_LIST_EXTENSIONS' => 'Lists all extensions in the database and on the filesystem.',
@ -65,6 +65,86 @@ $lang = array_merge($lang, array(
'CLI_DESCRIPTION_SET_ATOMIC_CONFIG' => 'Sets a configuration options value only if the old matches the current value', 'CLI_DESCRIPTION_SET_ATOMIC_CONFIG' => 'Sets a configuration options value only if the old matches the current value',
'CLI_DESCRIPTION_SET_CONFIG' => 'Sets a configuration options value', 'CLI_DESCRIPTION_SET_CONFIG' => 'Sets a configuration options value',
'CLI_HELP_PURGE_CACHE' => 'The <info>%command.name%</info> command allows you to purge the boards cache.
<info>php %command.full_name%</info>
',
'CLI_HELP_DELETE_CONFIG' => 'The <info>%command.name%</info> command deletes a configuration option. The key name is required.
<info>php %command.full_name% config_key</info>
',
'CLI_HELP_GET_CONFIG' => 'The <info>%command.name%</info> command gets a configuration options value. The key name is required.
<info>php %command.full_name% config_key</info>
',
'CLI_HELP_INCREMENT_CONFIG' => 'The <info>%command.name%</info> command increments an integer configuration options value. The key name and increment amount are required.
<info>php %command.full_name% config_key 1</info>
If the configuration option changes too frequently to be efficiently cached, use the <info>--dynamic</info> or <info>-d</info> option:
<info>php %command.full_name% config_key 1 --dynamic</info>
<info>php %command.full_name% config_key 1 -d</info>
',
'CLI_HELP_SET_CONFIG' => 'The <info>%command.name%</info> sets a configuration options value. The key name and value are required.
<info>php %command.full_name% config_key foo</info>
If the configuration option changes too frequently to be efficiently cached, use the <info>--dynamic</info> or <info>-d</info> option:
<info>php %command.full_name% config_key foo --dynamic</info>
<info>php %command.full_name% config_key foo -d</info>
',
'CLI_HELP_SET_ATOMIC_CONFIG' => 'The <info>%command.name%</info> command sets a configuration options value only if the old value matches the current value or the configuration value does not exist yet. The key name, old and new values are required.
<info>php %command.full_name% config_name foo bar</info>
If the configuration option changes too frequently to be efficiently cached, use the <info>--dynamic</info> or <info>-d</info> option:
<info>php %command.full_name% config_key foo bar --dynamic</info>
<info>php %command.full_name% config_key foo bar -d</info>
',
'CLI_HELP_CRON_LIST' => 'The <info>%command.name%</info> command prints a list of ready and unready cron jobs.
<info>php %command.full_name%</info>
',
'CLI_HELP_CRON_RUN' => 'The <info>%command.name%</info> command runs all ready cron tasks.
<info>php %command.full_name%</info>
Optionally you can specify a cron task name to run only the specified cron task:
<info>php %command.full_name% task_name</info>
',
'CLI_HELP_DB_MIGRATE' => 'The <info>%command.name%</info> command updates the database by applying available migrations.
<info>php %command.full_name%</info>
',
'CLI_HELP_FIND_MIGRATIONS' => 'The <info>%command.name%</info> command finds migrations that are not depended upon.
<info>php %command.full_name%</info>
',
'CLI_HELP_DISABLE_EXTENSION' => 'The <info>%command.name%</info> command disables the specified extension. The extension name is required.
<info>php %command.full_name% vendor_name/package_name</info>
',
'CLI_HELP_ENABLE_EXTENSION' => 'The <info>%command.name%</info> command enables the specified extension. The extension name is required.
<info>php %command.full_name% vendor_name/package_name</info>
',
'CLI_HELP_PURGE_EXTENSION' => 'The <info>%command.name%</info> command purges the specified extension. The extension name is required.
<info>php %command.full_name% vendor_name/package_name</info>
',
'CLI_HELP_LIST_EXTENSIONS' => 'The <info>%command.name%</info> command lists all extensions in the database and on the filesystem.
<info>php %command.full_name%</info>
',
'CLI_HELP_RECALCULATE_EMAIL_HASH' => 'The <info>%command.name%</info> command recalculates the user_email_hash column of the users table.
<info>php %command.full_name%</info>
',
'CLI_EXTENSION_DISABLE_FAILURE' => 'Could not disable extension %s', 'CLI_EXTENSION_DISABLE_FAILURE' => 'Could not disable extension %s',
'CLI_EXTENSION_DISABLE_SUCCESS' => 'Successfully disabled extension %s', 'CLI_EXTENSION_DISABLE_SUCCESS' => 'Successfully disabled extension %s',
'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s', 'CLI_EXTENSION_ENABLE_FAILURE' => 'Could not enable extension %s',

View file

@ -60,6 +60,7 @@ class purge extends \phpbb\console\command\command
$this $this
->setName('cache:purge') ->setName('cache:purge')
->setDescription($this->user->lang('PURGE_CACHE')) ->setDescription($this->user->lang('PURGE_CACHE'))
->setHelp($this->user->lang('CLI_HELP_PURGE_CACHE'))
; ;
} }

View file

@ -26,6 +26,7 @@ class delete extends command
$this $this
->setName('config:delete') ->setName('config:delete')
->setDescription($this->user->lang('CLI_DESCRIPTION_DELETE_CONFIG')) ->setDescription($this->user->lang('CLI_DESCRIPTION_DELETE_CONFIG'))
->setHelp($this->user->lang('CLI_HELP_DELETE_CONFIG'))
->addArgument( ->addArgument(
'key', 'key',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -27,6 +27,7 @@ class get extends command
$this $this
->setName('config:get') ->setName('config:get')
->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG')) ->setDescription($this->user->lang('CLI_DESCRIPTION_GET_CONFIG'))
->setHelp($this->user->lang('CLI_HELP_GET_CONFIG'))
->addArgument( ->addArgument(
'key', 'key',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -27,6 +27,7 @@ class increment extends command
$this $this
->setName('config:increment') ->setName('config:increment')
->setDescription($this->user->lang('CLI_DESCRIPTION_INCREMENT_CONFIG')) ->setDescription($this->user->lang('CLI_DESCRIPTION_INCREMENT_CONFIG'))
->setHelp($this->user->lang('CLI_HELP_INCREMENT_CONFIG'))
->addArgument( ->addArgument(
'key', 'key',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -27,6 +27,7 @@ class set extends command
$this $this
->setName('config:set') ->setName('config:set')
->setDescription($this->user->lang('CLI_DESCRIPTION_SET_CONFIG')) ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_CONFIG'))
->setHelp($this->user->lang('CLI_HELP_SET_CONFIG'))
->addArgument( ->addArgument(
'key', 'key',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -27,6 +27,7 @@ class set_atomic extends command
$this $this
->setName('config:set-atomic') ->setName('config:set-atomic')
->setDescription($this->user->lang('CLI_DESCRIPTION_SET_ATOMIC_CONFIG')) ->setDescription($this->user->lang('CLI_DESCRIPTION_SET_ATOMIC_CONFIG'))
->setHelp($this->user->lang('CLI_HELP_SET_ATOMIC_CONFIG'))
->addArgument( ->addArgument(
'key', 'key',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -40,6 +40,7 @@ class cron_list extends \phpbb\console\command\command
$this $this
->setName('cron:list') ->setName('cron:list')
->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_LIST')) ->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_LIST'))
->setHelp($this->user->lang('CLI_HELP_CRON_LIST'))
; ;
} }

View file

@ -50,6 +50,7 @@ class run extends \phpbb\console\command\command
$this $this
->setName('cron:run') ->setName('cron:run')
->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_RUN')) ->setDescription($this->user->lang('CLI_DESCRIPTION_CRON_RUN'))
->setHelp($this->user->lang('CLI_HELP_CRON_RUN'))
->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1')) ->addArgument('name', InputArgument::OPTIONAL, $this->user->lang('CLI_DESCRIPTION_CRON_RUN_ARGUMENT_1'))
; ;
} }

View file

@ -52,6 +52,7 @@ class migrate extends \phpbb\console\command\command
$this $this
->setName('db:migrate') ->setName('db:migrate')
->setDescription($this->user->lang('CLI_DESCRIPTION_DB_MIGRATE')) ->setDescription($this->user->lang('CLI_DESCRIPTION_DB_MIGRATE'))
->setHelp($this->user->lang('CLI_HELP_DB_MIGRATE'))
; ;
} }

View file

@ -31,6 +31,7 @@ class migration_tips extends \phpbb\console\command\command
$this $this
->setName('dev:migration-tips') ->setName('dev:migration-tips')
->setDescription($this->user->lang('CLI_DESCRIPTION_FIND_MIGRATIONS')) ->setDescription($this->user->lang('CLI_DESCRIPTION_FIND_MIGRATIONS'))
->setHelp($this->user->lang('CLI_HELP_FIND_MIGRATIONS'))
; ;
} }

View file

@ -23,6 +23,7 @@ class disable extends command
$this $this
->setName('extension:disable') ->setName('extension:disable')
->setDescription($this->user->lang('CLI_DESCRIPTION_DISABLE_EXTENSION')) ->setDescription($this->user->lang('CLI_DESCRIPTION_DISABLE_EXTENSION'))
->setHelp($this->user->lang('CLI_HELP_DISABLE_EXTENSION'))
->addArgument( ->addArgument(
'extension-name', 'extension-name',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -23,6 +23,7 @@ class enable extends command
$this $this
->setName('extension:enable') ->setName('extension:enable')
->setDescription($this->user->lang('CLI_DESCRIPTION_ENABLE_EXTENSION')) ->setDescription($this->user->lang('CLI_DESCRIPTION_ENABLE_EXTENSION'))
->setHelp($this->user->lang('CLI_HELP_ENABLE_EXTENSION'))
->addArgument( ->addArgument(
'extension-name', 'extension-name',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -23,6 +23,7 @@ class purge extends command
$this $this
->setName('extension:purge') ->setName('extension:purge')
->setDescription($this->user->lang('CLI_DESCRIPTION_PURGE_EXTENSION')) ->setDescription($this->user->lang('CLI_DESCRIPTION_PURGE_EXTENSION'))
->setHelp($this->user->lang('CLI_HELP_PURGE_EXTENSION'))
->addArgument( ->addArgument(
'extension-name', 'extension-name',
InputArgument::REQUIRED, InputArgument::REQUIRED,

View file

@ -22,6 +22,7 @@ class show extends command
$this $this
->setName('extension:show') ->setName('extension:show')
->setDescription($this->user->lang('CLI_DESCRIPTION_LIST_EXTENSIONS')) ->setDescription($this->user->lang('CLI_DESCRIPTION_LIST_EXTENSIONS'))
->setHelp($this->user->lang('CLI_HELP_LIST_EXTENSIONS'))
; ;
} }

View file

@ -32,6 +32,7 @@ class recalculate_email_hash extends \phpbb\console\command\command
$this $this
->setName('fixup:recalculate-email-hash') ->setName('fixup:recalculate-email-hash')
->setDescription($this->user->lang('CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH')) ->setDescription($this->user->lang('CLI_DESCRIPTION_RECALCULATE_EMAIL_HASH'))
->setHelp($this->user->lang('CLI_HELP_RECALCULATE_EMAIL_HASH'))
; ;
} }