drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

PHP fatal error when help option is misspelled #5504

Open Chi-teck opened 1 year ago

Chi-teck commented 1 year ago

To Reproduce

$ drush st -help
PHP Fatal error:  Uncaught Error: Call to undefined method Consolidation\AnnotatedCommand\AnnotatedCommand::setCommand() in /var/www/d10/web/vendor/symfony/console/Application.php:565
Stack trace:
#0 /var/www/d10/web/vendor/symfony/console/Application.php(668): Symfony\Component\Console\Application->get()
#1 /var/www/d10/web/vendor/drush/drush/src/Application.php(208): Symfony\Component\Console\Application->find()
#2 /var/www/d10/web/vendor/drush/drush/src/Application.php(192): Drush\Application->bootstrapAndFind()
#3 /var/www/d10/web/vendor/symfony/console/Application.php(256): Drush\Application->find()
#4 /var/www/d10/web/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun()
#5 /var/www/d10/web/vendor/drush/drush/src/Runtime/Runtime.php(126): Symfony\Component\Console\Application->run()
#6 /var/www/d10/web/vendor/drush/drush/src/Runtime/Runtime.php(53): Drush\Runtime\Runtime->doRun()
#7 /var/www/d10/web/vendor/drush/drush/drush.php(77): Drush\Runtime\Runtime->run()
#8 /var/www/d10/web/vendor/drush/drush/drush(4): require('...')
#9 /var/www/d10/web/vendor/bin/drush(120): include('...')
#10 {main}
  thrown in /var/www/d10/web/vendor/symfony/console/Application.php on line 565

System Configuration

Q A
Drush version? 12.x
Drupal version? 10.x
PHP version 8.x
OS? Linux
weitzman commented 1 year ago

I looked into this. Our help command does not have setCommand like Console's helpCommand does. We'd have to put it on AnnotatedCommand I think for it to fix this buglet. Not sure if thats best fix.

greg-1-anderson commented 1 year ago

Haven't looked, but sounds best.

Chi-teck commented 1 year ago

The issue still exists in 12.x.