[x] Per GitHub's Terms of Service, I am aware that I license my
contribution under the same terms as this project's license, and
that I have the right to license my contribution under those terms.
cc: @mbland
This PR adds an extra argument to @go.prompt_for_input. If the function is called with this argument, eg @go.prompt_for_input 'variable' 'prompt' '' '' 'required' and the user supplies no value, ie presses only enter, the prompt will reappear until the user actually supplies something. If instead of required another value is supplied, the behavior is the already existing one.
The rational behind this PR is that as it stands now, using @go.prompt_for_input in a loop to force the user to actually submit sth, is exactly identical to using read directly. It saves nothing. With this PR, it only takes one line and you are sure that the user will provide some input. Moreover, @go.prompt_for_yes_or_no already loops until the user supplies something. This PR makes the two functions more "feature compatible".
Coverage increased (+0.007%) to 95.004% when pulling 78d77b3b2008715eca5b3d5305caba31a880c712 on tterranigma:prompt into 292e0803074eb538ab8633a657c53d3a975ba922 on mbland:master.
cc: @mbland
This PR adds an extra argument to
@go.prompt_for_input
. If the function is called with this argument, eg@go.prompt_for_input 'variable' 'prompt' '' '' 'required'
and the user supplies no value, ie presses only enter, the prompt will reappear until the user actually supplies something. If instead ofrequired
another value is supplied, the behavior is the already existing one.The rational behind this PR is that as it stands now, using
@go.prompt_for_input
in a loop to force the user to actually submit sth, is exactly identical to usingread
directly. It saves nothing. With this PR, it only takes one line and you are sure that the user will provide some input. Moreover,@go.prompt_for_yes_or_no
already loops until the user supplies something. This PR makes the two functions more "feature compatible".