platformsh/legacy-cli

The -y/-n options are misleading

Closed this issue · 4 comments

The global -y option is described like this: Answer "yes" to any yes/no questions, which is misleading IMHO (same for the -n one).

What it does is that it only answers confirmation questions (like confirming that you do want to push to master), but it does nothing on option questions that can also have yes/no answers (like --sensitive on variable:create for instance ).

But from a user perspective, the difference is very subtle:

Are you sure you want to push to the master (production) branch? [Y/n]

vs

Is the value JSON-formatted? [y|N]

For instance, when creating a variable, I don't want to answer all questions, the defaults are fine most of the time, but the only way to disable interaction is to use either --yes or --no as the Symfony --no-interaction option is not available for some reason. You can use either option as we are only interested in their side-effect here. I know that I can also set the PLATFORMSH_CLI_NO_INTERACTION environment variable, but that makes typing a lot with many possible typos (not even talking about Windows support :)).

I'm not sure how to improve over the current situation, but as a new user, I find the current behavior rather unintuitive.

Agreed, it's a hangover from when it was mainly for Drupal users, who had Drush's equivalent -y/-n to contend with, and there was a clash between Symfony Console's -n (meaning "go ahead without interaction") and Drush's -n (meaning "answer no to confirm questions", or "don't go ahead", more like a dry run)

We could add --no-interaction in addition to the current options

And maybe look at modifying help output to show legacy vs current options

I believe this is fixed with 42472e8