Bug 1263947 - [origin_userinterface_542]CLI doesn’t show any suggestion for some commands
[origin_userinterface_542]CLI doesn’t show any suggestion for some commands
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Command Line Interface (Show other bugs)
3.x
Unspecified Unspecified
medium Severity medium
: ---
: ---
Assigned To: Fabiano Franz
Wei Sun
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-09-17 03:17 EDT by Wei Sun
Modified: 2015-11-23 16:16 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-23 16:16:24 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Wei Sun 2015-09-17 03:17:58 EDT
Description of problem:
For some commands,CLI doesn't give any suggestion.

Version-Release number of selected component (if applicable):
oc v1.0.6-62-gf74feb9
kubernetes v1.1.0-alpha.0-1605-g44c91b1
devenv_fedora_2355

How reproducible:
Always

Steps to Reproduce:
1.For rollback command
$ oc roll -h
Error: unknown command "roll" for "oc"
Run 'oc --help' for usage.
$ oc back -h
Error: unknown command "back" for "oc"
Run 'oc --help' for usage.
$ oc rback -h
Error: unknown command "rback" for "oc"
Run 'oc --help' for usage.

2.For new-app command
$ oc app -h
Error: unknown command "app" for "oc"
Run 'oc --help' for usage.

3.For some related to build commands
$ oc builds -h
Error: unknown command "builds" for "oc"
Run 'oc --help' for usage.
$ oc build -h
Error: unknown command "build" for "oc"
Run 'oc --help' for usage.

4.For deploy command
$ oc deployment -h
Error: unknown command "deployment" for "oc"
Run 'oc --help' for usage.
$ oc build -h
Error: unknown command "build" for "oc"
Run 'oc --help' for usage.

5.For image command
$ oc image
Error: unknown command "image" for "oc"
Run 'oc --help' for usage.

6.For annotate command
$ oc anot
Error: unknown command "anot" for "oc"
Run 'oc --help' for usage.


Actual results:
No any suggestion from CLI

Expected results:
Give some suggestion commands

Additional info:
Comment 1 Fabiano Franz 2015-09-28 11:07:34 EDT
There's a PR opened for Cobra, waiting for it to get merged so that we can bump it in OpenShift and get this fixed.

https://github.com/spf13/cobra/pull/163
Comment 2 Fabiano Franz 2015-09-29 20:31:38 EDT
Fixed in https://github.com/openshift/origin/pull/4859

Notice that not all ideas listed were implemented. We have to take care to not be too much aggressive in the suggestions. So "back", "rback" and "anot" where not implemented. The rules to suggest a similar command are basically these:

1. Levenshtein with a minimum distance of 2 (case insensitive);
2. Prefix match (so that, for example, we suggest "new-app" and "new-project" when the user tries "oc new");
3. A few explicit suggestions (for example, suggest "delete" when the user tries "oc remove", suggestions for "build", "builds", "deployment", "image", "app" and a couple others).
Comment 3 weiwei jiang 2015-09-30 05:00:34 EDT
Checked with devenv-fedora_2430, and the issue has been fixed.

Note You need to log in before you can comment on or make changes to this bug.