"Did you mean one of these?" results make little sense
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
Changed in python-openstackclient: | |
status: | Confirmed → Won't Fix |
this is performed by cliff, and implements the Demeraou- Levenshtein algorithm to find matches. see commit https:/ /github. com/openstack/ cliff/commit/ 3396764571f5e18 f99a63f1f1160a0 a6a1b3097a 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)