New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix display of virtctl help text for other usages #4265
Fix display of virtctl help text for other usages #4265
Conversation
3d2fee0
to
9f98845
Compare
9f98845
to
e989887
Compare
|
/test pull-kubevirt-e2e-k8s-1.18 |
|
@dhiller: The specified target(s) for
Use In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/lgtm |
pkg/virtctl/root.go
Outdated
| // see also templates.go | ||
| func GetProgramName(binary string) string { | ||
| if strings.HasSuffix(binary, "-virt") { | ||
| return binary[0:len(binary)-len("-virt")] + " virt" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about fmt.Sprintf("%s virt", strings.TrimSuffix(binary, "-virt"))?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the suggestion, replaced.
In case where either the virtctl binary or the symlink does not exactly match the expectation the name virtctl is displayed in the help text. This is now generalized by only looking for the suffix `-virt` and then displaying `... virt` in the help text. Signed-off-by: Daniel Hiller <daniel.hiller.1972@gmail.com>
e989887
to
f1b9d8b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rmohr The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest |
3 similar comments
|
/retest |
|
/retest |
|
/retest |
What this PR does / why we need it:
In the case where either the virtctl binary or the symlink does not exactly
match the expectation the name virtctl is displayed in the help text.
This is now generalized by only looking for the suffix
-virtand thendisplaying
... virtin the help text.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
Release note: