Note: The title of this feature suggestion might be slightly misleading as I was not able to phrase it properly due to title length limitations. Please read this message fully to understand what this feature suggestion is about.
Feature suggestion
Allow input to be programmatically (i.e. via GreyScript code) passed to a program without needing the program's developer to add explicit support for it (i.e. via custom objects).
Reason for suggesting this feature
Currently, most tools in Grey Hack are interactive (meaning that they use the user_input function instead of launch parameters to receive user input), it would be nice if there was a way for the user_input function to return not just input manually entered in by the player via the terminal, but also input passed via GreyScript code (if any). This would allow for more flexibility in automation.
For example, in real life, a command-line program usually expects input via stdin, this allows input to be programmatically (i.e. via code) passed to the program by writing to its stdin buffer. In this case, input can be passed to that program programmatically without waiting for its developer to explicitly add support for programmatically passing input to it.
What the end result of implementing this feature might look like
// A simple script (written in GreyScript) that automates the process of passing input to an interactive program (called 'interactive-cli' in this case) that receives input via the `user_input` function instead of launch parameters.
launch(
"/usr/bin/interactive-cli",
"",
// A 3rd parameter could be added to the `launch` function that allows input that will be passed to the `user_input` function to be specified.
"command-1\ncommand-2 arg-1\ncommand-3"
)
For further reference
Link to the starting comment of a discussion regarding this feature suggestion: #coding message