drush argument for choice should expect an int

Created on 1 April 2021, almost 4 years ago
Updated 13 July 2023, over 1 year ago

When using the drush import command, the `--choice` parameter only allows the full, safe or force options. However, running the command without the parameter, we are presented with these options and are expected to entered an int (0, 1, 2, 3):

 What import style would you like?:
  [0] Cancel
  [1] Full
  [2] Safe
  [3] Force
 >

Should it not accept int values as the parameter options instead of the strings?

✨ Feature request
Status

Active

Version

2.0

Component

User interface

Created by

πŸ‡ΊπŸ‡ΈUnited States dystopianblue

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

    I would be more in favor of using/allowing full words in the interactive user interface.

    Especially since at some point a change was made so there is no more [0] Cancel, the off-by-one nature of the choices ("press 1 to get the second option") makes significant mistakes easy.

    Either way, drush ia --help needs to list what the options actually are, rather than only " --choice[=CHOICE] Import style choice.".

    I had to find this issue to figure out what i could put! And yes i tried an integer first. So yes i agree that the interactive and the pre-selected approaches to using the command line should align, but at least the option of using words feels safer and more intuitive to me.

Production build 0.71.5 2024