Skip to content
This repository has been archived by the owner on Dec 21, 2023. It is now read-only.

Command --options don't work on CLI #10

Closed
jameswilson opened this issue Jul 17, 2018 · 2 comments
Closed

Command --options don't work on CLI #10

jameswilson opened this issue Jul 17, 2018 · 2 comments
Assignees

Comments

@jameswilson
Copy link
Member

I added a way to use command options for the drupal:backup command, and even documented it on issue #8 how these are in theory supposed to work.

However, for some reason the commands are not being picked up.

$ composer run spark drupal:backup --timeout=0 --keep="30 days"

[Symfony\Component\Console\Exception\RuntimeException]  
  The "--keep" option does not exist.   

@balintbrews balintbrews changed the title Command --options dont work on cli Command --options don't work on CLI Jul 17, 2018
@balintbrews
Copy link
Contributor

balintbrews commented Sep 26, 2018

This happens because composer run-script passes all arguments which start with -- to composer itself, rather than to the script it runs. In order to have them passed to the script, we need to signify the end of the the Composer options with a double-dash.

The example command you posted should be issued the following way:

$ composer run spark drupal:backup --timeout=0 -- --keep="30 days"

Obviously, this is not ideal for Spark. Even when we don't intend to pass anything to Composer, we'd need to use the double-dash when we use an argument. E.g.:

$ composer run spark -- mysql:dump --non-sanitized

#36 is my proposal to overcome this.

I recommend that we take that approach and close this issue.

@jameswilson
Copy link
Member Author

@balintk Agreed. closing this in favor of #36.

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

No branches or pull requests

2 participants