function config_devel_drush_command in Configuration development 8
Implements hook_drush_command().
File
- drush/
config_devel.drush.inc, line 13 - Configuration development module drush integration.
Code
function config_devel_drush_command() {
$items = array();
$description = '';
$description .= "List which configuration settings you want to export in the\n";
$description .= "module's info file by listing them under 'config_devel', as shown below:\n";
$description .= "\n";
$description .= "config_devel:\n";
$description .= " install:\n";
$description .= " - entity.view_display.node.article.default\n";
$description .= " - entity.view_display.node.article.teaser\n";
$description .= " - field.instance.node.article.body\n";
$description .= " optional:\n";
$description .= " - field.instance.node.article.tags\n";
$items['config-devel-export'] = array(
'description' => "Write back configuration to module's config directory.\n" . $description,
'arguments' => array(
'module' => 'Module machine name.',
),
'options' => array(),
'required-arguments' => TRUE,
'examples' => array(
'drush config-devel-export MODULE_NAME' => 'Write back configuration to the specified module, based on .info file.',
),
'aliases' => array(
'cde',
'cd-em',
),
);
$items['config-devel-import'] = array(
'description' => "Import configuration from module's config directory to active storage.\n" . $description,
'arguments' => array(
'module' => 'Module machine name.',
),
'options' => array(),
'required-arguments' => TRUE,
'examples' => array(
'drush config-devel-import MODULE_NAME' => 'Import configuration from the specified module into the active storage, based on .info file.',
),
'aliases' => array(
'cdi',
'cd-im',
),
);
$items['config-devel-import-one'] = array(
'description' => "Import a single configuration item from module's config directory to active storage.\n" . $description,
'arguments' => array(
'path' => 'Config file name.',
),
'options' => array(),
'required-arguments' => TRUE,
'examples' => array(
'drush config-devel-import-one system.site.yml' => 'Import the contents of system.site.yml into the config object system.site.',
'drush config-devel-import-one system.site' => 'Import the standard input into the config object system.site. Helpful for scripting copying to remote',
),
'aliases' => array(
'cdi1',
'cd-i1',
),
);
return $items;
}