function drush_rules_export in Rules 7.2
Same name and namespace in other branches
- 8.3 rules.drush.inc \drush_rules_export()
Exports a single rule.
File
- ./
rules.drush.inc, line 238 - Rules module drush integration.
Code
function drush_rules_export() {
$args = func_get_args();
$rule_name = !empty($args) && is_array($args) ? array_shift($args) : '';
if (empty($rule_name)) {
return drush_set_error('', dt('No rule name given.'));
}
$rule = rules_config_load($rule_name);
if (empty($rule)) {
return drush_set_error('', dt('Could not load rule named "!rule-name".', array(
'!rule-name' => $rule_name,
)));
}
drush_print($rule
->export());
drush_log(dt('The rule "!name" has been exported.', array(
'!name' => $rule_name,
)), 'success');
}