"Did you mean one of these?" results make little sense

Bug #1565849 reported by Matthew Edmonds
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Won't Fix
Wishlist
Unassigned

Bug Description

It's nice that openstackclient tries to help suggest a command when you've mistyped one, but it doesn't do this very well... E.g., if I type "openstack role" instead of showing me:

Did you mean one of these?
  role add
  role assignment list
  role create
  role delete
  role list
  role remove
  role set
  role show

it shows a much longer list including a bunch of things that have nothing to do with role:

Did you mean one of these?
  role add
  role assignment list
  role create
  role delete
  role list
  role remove
  role set
  role show
  module list
  router create
  router delete
  router list
  router set
  router show
  volume create
  volume delete
  volume list
  volume qos associate
  volume qos create
  volume qos delete
  volume qos disassociate
  volume qos list
  volume qos set
  volume qos show
  volume qos unset
  volume set
  volume show
  volume type create
  volume type delete
  volume type list
  volume type set
  volume type show
  volume type unset
  volume unset

And if I type "openstack create", where you might expect to get a list of all the many create subcommands (role create, project create, etc.), instead you get this:

Did you mean one of these?
  aggregate add host
  aggregate create
  aggregate delete
  aggregate list
  aggregate remove host
  aggregate set
  aggregate show

Revision history for this message
Steve Martinelli (stevemar) wrote :

this is performed by cliff, and implements the Demeraou-Levenshtein algorithm to find matches. see commit https://github.com/openstack/cliff/commit/3396764571f5e18f99a63f1f1160a0a6a1b3097a for additional details.

I suspect "role' is matching with router and volume since 3 out of 4 letters match (r, o ,e with router and o, l, e with volume) in order.

The `openstack create` case won't bring up all the `create` results since our implementation only matches the object/noun, not the verb (which is why it's brining up aggregate (r, e, t, e from create)

Revision history for this message
Dean Troyer (dtroyer) wrote :

This should be 'wont fix' but it a datapoint in the needs of reworking help so I am leaving it as confirmed for now.

Changed in python-openstackclient:
importance: Undecided → Wishlist
status: New → Confirmed
Artem Goncharov (gtema)
Changed in python-openstackclient:
status: Confirmed → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.