Skip to content

Commit

Permalink
Add lib and add register its _completion command
Browse files Browse the repository at this point in the history
  • Loading branch information
weitzman committed Mar 9, 2017
1 parent 15d22ab commit c2e838b
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@
"pear/console_table": "~1.3.0",
"phpdocumentor/reflection-docblock": "^2.0",
"webmozart/path-util": "~2",
"sebastian/version": "~1"
"sebastian/version": "~1",
"stecman/symfony-console-completion": "^0.7.0"
},
"require-dev": {
"lox/xhprof": "dev-master",
Expand Down
49 changes: 47 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion includes/drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ function drush_get_global_options($brief = FALSE) {
$options['yes'] = array('short-form' => 'y', 'context' => 'DRUSH_AFFIRMATIVE', 'description' => "Assume 'yes' as answer to all prompts.");
$options['no'] = array('short-form' => 'n', 'context' => 'DRUSH_NEGATIVE', 'description' => "Assume 'no' as answer to all prompts.");
$options['simulate'] = array('short-form' => 's', 'context' => 'DRUSH_SIMULATE', 'never-propagate' => TRUE, 'description' => "Simulate all relevant actions (don't actually change the system).", 'symfony-conflict' => TRUE);
$options['pipe'] = array('short-form' => 'p', 'hidden' => TRUE, 'description' => "Emit a compact representation of the command for scripting.");
// $options['pipe'] = array('short-form' => 'p', 'hidden' => TRUE, 'description' => "Emit a compact representation of the command for scripting.");
$options['help'] = array('short-form' => 'h', 'description' => "This help system.");

if (!$brief) {
Expand Down
4 changes: 4 additions & 0 deletions includes/preflight.inc
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,10 @@ function drush_preflight_prepare() {
drush_init_annotation_commands($container);
drush_init_application_global_options($container);

// Add completion command
$commandFileInstance = new \Stecman\Component\Symfony\Console\BashCompletion\CompletionCommand();
drush_add_command_instance($container, $commandFileInstance);

// Terminate immediately unless invoked as a command line script
if (!drush_verify_cli()) {
return drush_set_error('DRUSH_REQUIREMENTS_ERROR', dt('Drush is designed to run via the command line.'));
Expand Down

0 comments on commit c2e838b

Please sign in to comment.