Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removal of global option "no" is gone? Currently parsing it like --yes ! #6179

Closed
MakerTim opened this issue Dec 11, 2024 · 3 comments
Closed

Comments

@MakerTim
Copy link
Contributor

Describe the bug
I cannot find the docs, but we used to do commands as dry-run / sanity check;
Things like drush cim -n (kinda like what config:status does)
but now the no-shorthand is interpreted as a YES -- that cannot be right!

Also help-section Global options has no mention about the "no" argument.

To Reproduce
Use a command that uses a yes/no promt (eg. drush cim or drush sqlsan)
See that it requires a promt
now add -n and see that it is interpreted like yes
now change the -n into --no and see that it is interpreted like no

Expected behavior
-n should be the shorthand for --no (or at leased not yes)

Actual behavior
-n is now the shorthand for --yes
Or more likely the --no-interaction ?
didnt look at the code yet

Workaround
write fullout --no arg

System Configuration

Q A
Drush version? detected at 13.3.3.0
Drupal version? at leased found in 10.x and 9.x
PHP version all
OS? all

Additional information
Add any other context about the problem here.

@weitzman
Copy link
Member

Yes this changed several years ago when we adopted symfony console. -n in all console apps is short for --no-interaction which does behave similar to --yes. Use --no to get old behavior.

@gitressa
Copy link
Contributor

Thanks for raising this and a fast answer.

--no works well, but ends in an error, though it's not ... I seem to recall other Drush issues, where the final part of the Drush feedback message is an error, where it shouldn't. So the last three last lines should ideally not be included ...

In ConfigExportCommands.php line 146:            
  Cancelled.               
Failed to run drush config:export --no: exit status 1

... but --no does work well :)

$ drush config:export --no
 [notice] Differences of the active config to the export directory:
+------------+-----------------------------------------------+-----------+
| Collection | Config                                        | Operation |
+------------+-----------------------------------------------+-----------+
|            | field.storage.node.field_plaion               | Create    |
|            | field.field.node.article.field_plaion         | Create    |
|            | admin_toolbar.settings                        | Create    |
|            | admin_toolbar_search.settings                 | Create    |
|            | admin_toolbar_tools.settings                  | Create    |
|            | core.extension                                | Update    |
|            | core.entity_form_display.node.article.default | Update    |
|            | core.entity_view_display.node.article.teaser  | Update    |
|            | core.entity_view_display.node.article.rss     | Update    |
|            | core.entity_view_display.node.article.default | Update    |
+------------+-----------------------------------------------+-----------+


 !                                                                                                                     
 ! [WARNING] The .yml files in your export directory (sites/default/files/sync) will be deleted and replaced with the  
 !           active config.: no.                                                                                       
 !                                                                                                                     

In ConfigExportCommands.php line 146:            
  Cancelled.               
Failed to run drush config:export --no: exit status 1

@weitzman
Copy link
Member

Now you are changing the intent of this issue. Feel free to discuss in #6162

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants