In my situation, I needed to answer some questions without Y or N, but with text or a space. I found a better way to do this in my situation, to create a shellscript file. In my case, I called it autocomplete.sh
I needed to answer some questions for the doctrine scheme exporter, so my file looked like this.
- This is an example only -
php vendor/bin/mysql-workbench-schema-export mysqlworkbenchfile.mwb ./doctrine << EOF `#Export to Doctrine Annotation Format` 1 `#Would you like to change the setup configuration before exporting` y `#Log to console` y `#Log file` testing.log `#Filename [%entity%.%extension%]` `#Indentation [4]` `#Use tabs [no]` `#Eol delimeter (win, unix) [win]` `#Backup existing file [yes]` `#Add generator info as comment [yes]` `#Skip plural name checking [no]` `#Use logged storage [no]` `#Sort tables and views [yes]` `#Export only table categorized []` `#Enhance many to many detection [yes]` `#Skip many to many tables [yes]` `#Bundle namespace []` `#Entity namespace []` `#Repository namespace []` `#Use automatic repository [yes]` `#Skip column with relation [no]` `#Related var name format [%name%%related%]` `#Nullable attribute (auto, always) [auto]` `#Generated value strategy (auto, identity, sequence, table, none) [auto]` `#Default cascade (persist, remove, detach, merge, all, refresh, ) [no]` `#Use annotation prefix [ORM\]` `#Skip getter and setter [no]` `#Generate entity serialization [yes]` `#Generate extendable entity [no]` y `#Quote identifier strategy (auto, always, none) [auto]` `#Extends class []` `#Property typehint [no]` EOF
What I like about this strategy is that you can comment on what your answers are and using an EOF empty line is easy (default answer). It turns out that this exporter tool has its own JSON counterpart to answer these questions, but I figured it out after I did it =).
run the script just in the right directory and run 'sh autocomplete.sh' in the terminal.
In short, using <EOL and EOF in conjunction with return lines , you can answer every hint question if necessary. Each new line is a new answer.
My example shows how this can be done with comments, also using the `symbol, so that you remember what each step is.
Note another advantage of this method: you can answer with more than Y or N ... in fact, you can answer with spaces!
Hope this helps someone.