function node_export_drush_help in Node export 6.3
Same name and namespace in other branches
- 8 node_export.drush.inc \node_export_drush_help()
- 6.2 node_export.drush.inc \node_export_drush_help()
- 7.3 node_export.drush.inc \node_export_drush_help()
Implementation of hook_drush_help().
This function is called whenever a drush user calls 'drush help <name-of-your-command>'
Parameters
A string with the help section (prepend with 'drush:'):
Return value
A string with the help text for your command.
File
- ./
node_export.drush.inc, line 90 - Drush support for node_export.
Code
function node_export_drush_help($section) {
// This is to prevent duplication of information from hook_drush_command().
$commands = node_export_drush_command();
foreach ($commands as $command => $command_info) {
if ($section == 'drush:' . $command) {
$out = $command_info['description'];
if (isset($command_info['node_export alias for'])) {
$output .= "\nThis command is an alias for ";
$output .= $command_info['node_export alias for'] . ".";
}
if (isset($command_info['node_export command aliases'])) {
if (count($command_info['node_export command aliases']) == 1) {
$output .= "\nThis command can be called by it's alias; ";
$output .= $command_info['node_export command aliases'] . ".";
}
else {
$last_alias = array_pop($command_info['node_export command aliases']);
$output .= "\nThis command can be called by it's aliases; ";
$output .= implode(", ", $command_info['node_export command aliases']);
$output .= ", or " . $last_alias . ".";
}
}
$out .= "\n\nArguments:";
if (isset($command_info['arguments'])) {
foreach ($command_info['arguments'] as $k => $v) {
$out .= "\n " . $k . " : " . $v;
}
}
$out .= "\n\nOptions:";
if (isset($command_info['options'])) {
foreach ($command_info['options'] as $k => $v) {
$out .= "\n " . $k . " : " . $v;
}
}
$out .= "\n\nExamples:";
if (isset($command_info['examples'])) {
foreach ($command_info['examples'] as $k => $v) {
$out .= "\n \\'" . $k . "\\' : " . $v;
}
}
return dt($out);
}
}
}