Bug 2046137

Summary: oc output for unknown commands is not human readable
Product: OpenShift Container Platform Reporter: Evgeni Vakhonin <evakhoni>
Component: ocAssignee: Maciej Szulik <maszulik>
oc sub component: oc QA Contact: zhou ying <yinzhou>
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: aos-bugs, mfojtik
Version: 4.10   
Target Milestone: ---   
Target Release: 4.10.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-03-11 18:15:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Evgeni Vakhonin 2022-01-26 10:11:01 UTC
Description of problem:
When oc receives unknown command, there is a message mentioning the unknown command, and suggesting the possible commands instead. However in situations where oc cannot find any suggestion, the output received is not human readable, contains redundant “\ characters, missing newlines, and no possible solution

Version-Release number of selected component (if applicable):
Client Version: 4.10.0-0.nightly-2022-01-25-023600

How reproducible:
100%

Actual results:
oc blablabla
E0125 11:02:33.210573 1050830 run.go:120] "command failed" err="unknown command \"blablabla\" for \"oc\""

Expected results:
up to the dev, but should be readable

also, we can go clever and suggest 'oc help' if no other suggestions found:

oc blablabla
E0125 11:02:33.210573 1050830 run.go:120] "command failed" err=<
unknown command "blablabla" for "oc"

Did you mean this?
    help
>

Comment 1 Maciej Szulik 2022-01-27 16:18:00 UTC
This was fixed in https://github.com/openshift/oc/pull/1033

Comment 3 Evgeni Vakhonin 2022-01-27 17:25:29 UTC
well.. #1033 is merged in 4.10.0-0.nightly-2022-01-26-234447

reproducing
oc version
Client Version: 4.10.0-0.nightly-2022-01-18-044014

oc blablabla
E0127 19:18:16.202682 1527787 run.go:120] "command failed" err="unknown command \"blablabla\" for \"oc\""

verifying
oc version
Client Version: 4.10.0-0.nightly-2022-01-26-234447

oc blablabla
error: unknown command "blablabla" for "oc"

looks better
lgtm