Created
January 18, 2012 14:59
-
-
Save msonnabaum/1633377 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$commands = drush_get_commands(); | |
foreach ($commands as $name => $command) { | |
$output = theme_drush_command_docs($command); | |
file_put_contents("{$name}.md", $output); | |
} | |
function theme_drush_command_docs($command) { | |
$output = "#{$command['command']}"; | |
foreach ($command['arguments'] as $arg => $desc) { | |
$output .= "\n## Arguments"; | |
$output .= "\n* {$arg}: {$desc}"; | |
} | |
foreach ($command['options'] as $option => $desc) { | |
$output .= "\n## Options"; | |
$output .= "\n* {$option}: {$desc}"; | |
} | |
return $output; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment