5 * Shell alias commands. @see example.drushrc.php for details.
8 function shellalias_drush_help($section) {
10 case 'drush:shell-alias':
11 return dt('Print a shell alias record.');
16 * Command argument complete callback.
19 * Array of available site aliases.
21 function shellalias_shell_alias_complete() {
22 if ($all = drush_get_context('shell-aliases', array())) {
23 return array('values' => array_keys($all));
27 function shellalias_drush_command() {
30 $items['shell-alias'] = array(
31 'description' => 'Print all known shell alias records.',
32 'bootstrap' => DRUSH_BOOTSTRAP_NONE,
34 'alias' => 'Shell alias to print',
36 'outputformat' => array(
37 'default' => 'key-value',
38 'pipe-format' => 'json',
39 'simplify-single' => TRUE,
40 'output-data-type' => 'format-list',
42 'aliases' => array('sha'),
44 'drush shell-alias' => 'List all alias records known to drush.',
45 'drush shell-alias pull' => 'Print the value of the shell alias \'pull\'.',
52 * Print out the specified shell aliases.
54 function drush_core_shell_alias($alias = FALSE) {
55 $shell_aliases = drush_get_context('shell-aliases', array());
57 return $shell_aliases;
59 elseif (isset($shell_aliases[$alias])) {
60 return array($alias => $shell_aliases[$alias]);