Bug 2046137 - oc output for unknown commands is not human readable
Summary: oc output for unknown commands is not human readable
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.10
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.10.0
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-01-26 10:11 UTC by Evgeni Vakhonin
Modified: 2022-03-11 18:15 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-03-11 18:15:11 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

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


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