Symfony2 console character arguments versus options when to use

I would like to know any recommendations on using input arguments and input parameters to pass data to the symfony command console.

http://symfony.com/doc/current/components/console/introduction.html

I think that arguments should be used when the required data is needed to execute the command, otherwise use parameters.

Can you guys talk more about this? What standard?

+6
source share
1 answer

I would suggest using arguments when you want to specify the values ​​required by the execution, for example:

bin/console vendor:delete-entity 120 

but not

 bin/console vendor:delete-entity --id=120 

You can use the "Parameters" if you want to change the default execution script, for example:

 bin/console vendor:delete-entity 120 --dump-sql 

or

 bin/console vendor:bulk-create something --batch-size=100 
+9
source

Source: https://habr.com/ru/post/970302/


All Articles