Skip to content

Commit

Permalink
Remove support for 'labeled-export' format in variable-get, as it doe…
Browse files Browse the repository at this point in the history
…s not work well now that we are transforming the structure of the output with --exact. Make the default format 'yaml' instead. Also, support --format=yaml in variable-set.
  • Loading branch information
greg-1-anderson committed Feb 9, 2015
1 parent 4b58aa1 commit f522f7b
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions commands/core/variable.drush.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

use Symfony\Component\Yaml\Yaml;

/**
* Implementation of hook_drush_command().
*
Expand All @@ -23,13 +25,13 @@ function variable_drush_command() {
'examples' => array(
'drush vget' => 'List all variables and values.',
'drush vget user' => 'List all variables containing the string "user".',
'drush vget site_mail --exact' => 'Show the variable with the exact key "site_mail".',
'drush vget site_mail --exact' => 'Show only the value of the variable with the exact key "site_mail".',
),
'options' => array(
'exact' => 'Only get the one variable that exactly matches the specified name.',
'exact' => "Only get the one variable that exactly matches the specified name. Output will contain only the variable's value.",
),
'outputformat' => array(
'default' => 'labeled-export',
'default' => 'yaml',
'pipe-format' => 'config',
'variable-name' => 'variables',
'table-metadata' => array(
Expand Down Expand Up @@ -255,6 +257,10 @@ function _drush_variable_format($value, $format) {
case 'json':
$value = drush_json_decode($value);
break;

case 'yaml':
$value = Yaml::parse($value);
break;
}
return $value;
}
Expand Down

0 comments on commit f522f7b

Please sign in to comment.