'strongarm_drush_export', 'description' => 'Export variable(s).', ); return $items; } // Callback for strongarm command. function strongarm_drush_export() { $vars = func_get_args(); if (empty($vars)) { $result = db_query('SELECT name FROM variable'); $rows = array(array('Variables')); while ($row = db_fetch_array($result)) { $rows[] = array_values($row); } drush_print_table($rows, TRUE); } else { $exports = array(); foreach ($vars as $v) { // We use the very unlikely 'DRUSH_STRONGARM_NO_VALUE_HERE' as the // default value which *should* be ok, right? $variable = variable_get($v, 'DRUSH_STRONGARM_NO_VALUE_HERE'); if ($variable !== 'DRUSH_STRONGARM_NO_VALUE_HERE') { $exports[$v] = $variable; } } drush_print(var_export($exports)); } }