function drush_usage_show

8.0.x usage.drush.inc drush_usage_show()
6.x usage.drush.inc drush_usage_show()
7.x usage.drush.inc drush_usage_show()
5.x usage.drush.inc drush_usage_show()

Displays usage file.

File

commands/core/usage.drush.inc, line 81
Send scrubbed usage data to drush. Omits arguments and option values in order to assure that no sensitive data is shared. See http://drupal.org/node/1246738.

Code

function drush_usage_show() {
  $file = _drush_usage_get_file(TRUE);
  if ($file) {
    $json = '[' . file_get_contents($file) . ']';
    $usage_data = json_decode($json);
    foreach ($usage_data as $item) {
      $cmd = $item->cmd;
      $options = (array) $item->opt;
      array_unshift($options, '');
      drush_print($cmd . implode(' --', $options));
    }
  }
  else {
    return drush_set_error('DRUSH_NO_USAGE_FILE', dt('No usage file; set $options[\'drush_usage_log\'] = TRUE; in a .drushrc.php file to enable.'));
  }
}