Yeah that feels like a premature optomization as that limits your interface 
options significantly (to only 9 valid choices). I'm suprised there haven't 
been any other bugs related to this, but maybe there aren't a lot of cli 
use-cases out there with complex bug-reporting choices.
I've attached a branch that now readlines instance or read(1) for prompts which 
contain a large set of choices (> 10).


This merge proposal a bit more flexible as it'd also permit options where > 99 
choices are presented. I would think that > 99 choices would be a usability 
issues as I can't fathom people reading through 100+ separate options to 
actually choose the one that best applies to them.


I'm not sure the SRU team understood the impact of the branch. Per the pastebin 
that I provided originally, the user wouldn't have to input "3 " they would 
input "3<enter>" or "1<enter>" or "11".


I've since changes this branch to read until <enter> for all choices if the # 
or choices are > 10. This means that all existing apport use-cases retain the 
optimized 1 character choice selection if their provided choices are <= 9. For 
any lists larger than that (which is currently broken in apport) the user will 
have to hit enter after their choice.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/1722564

Title:
  apport question will not accept multi-character responses

Status in Apport:
  Confirmed
Status in apport package in Ubuntu:
  In Progress
Status in apport source package in Artful:
  In Progress

Bug description:
  the newly added cloud-init apport support shows a list of cloud
  providers and asks the user to select one.  There are currently 18
  options.  For any option > 10, apport will just take the '1' that is
  typed as the answer.

  It should obviously wait for more than one character or a carriage
  return.

  
  *** Please select the cloud vendor or environment in which this instance is 
running

  
  Choices:
    1: Amazon - Ec2
    2: AliYun
    3: AltCloud
    4: Azure
    5: Bigstep
    6: CloudSigma
    7: CloudStack
    8: DigitalOcean
    9: GCE - Google Compute Engine
    10: MAAS
    11: NoCloud
    12: OpenNebula
    13: OpenStack
    14: OVF
    15: Scaleway
    16: SmartOS
    17: VMware
    18: Other
    C: Cancel
  Please choose (1/2/3/4/5/6/7/8/9/10/11/12/13/14/15/16/17/18/C): 1

  ProblemType: Bug
  DistroRelease: Ubuntu 17.10
  Package: apport 2.20.7-0ubuntu2
  ProcVersionSignature: Ubuntu 4.13.0-12.13-generic 4.13.3
  Uname: Linux 4.13.0-12-generic x86_64
  ApportVersion: 2.20.7-0ubuntu2
  Architecture: amd64
  Date: Tue Oct 10 15:21:48 2017
  PackageArchitecture: all
  ProcEnviron:
   TERM=xterm-256color
   PATH=(custom, no user)
   LANG=C.UTF-8
  SourcePackage: apport
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/apport/+bug/1722564/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to