function drush_devel_generate_vocabs

Command callback. Generate a number of vocabularies.

1 string reference to 'drush_devel_generate_vocabs'
devel_generate_drush_command in devel_generate/devel_generate.drush.inc
Implementation of hook_drush_command().

File

devel_generate/devel_generate.drush.inc, line 126

Code

function drush_devel_generate_vocabs($num_vocab = 1) {
    if (drush_generate_is_number($num_vocab) == FALSE) {
        return drush_set_error('DEVEL_GENERATE_INVALID_INPUT', dt('Invalid number of vocabularies: !num.', array(
            '!num' => $num_vocab,
        )));
    }
    drush_generate_include_devel();
    if (drush_get_option('kill')) {
        devel_generate_delete_vocabularies();
        drush_log(dt('Deleted existing vocabularies.'), 'success');
    }
    $new_vocs = devel_generate_vocabs($num_vocab, '12');
    if (!empty($new_vocs)) {
        drush_log(dt("Created the following new vocabularies:\n!vocs", array(
            '!vocs' => implode("\n", $new_vocs),
        )), 'success');
    }
}