You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From the tanzu-core-cli team, a possible solution:
The formatting of the help output is done by the tanzu-plugin-runtime library, which is maintained by the CLI Core team. You can see the (very recently adjusted) code here.
For examples, because it is a multiline single string that Cobra receives, it cannot do indentation. You must do it yourself as you originally thought. Cobra will do the indentation for the first line. This is useful for cases where the example is a single line.
When dealing with a multiline example, you may want to use Go's back quote ` .
The example solution provide to us is: So the code would become
fmt.Sprintf(`%[1]s list
%[1]s list --output yaml`, c.Name)
Line breaks and spaces are respected with back quotes. Note their use of %[#]s format.
Describe the bug
if there are two or more example commands included in the help, only the first command is indented.
all the example commands should be indented
Expected behavior
all the example commands in help should be indented
Steps to Reproduce
Version (Apps plugin version, Version of K8s running on cluster)
Put the output of the following commad
tanzu version && tanzu apps version
Environment where the bug was observed (cloud, OS, etc)
Plugin version:
apps:v0.5.1
k8s version (server):
GitVersion:"v1.23.3+vmware.1"
MacOS, Docker Desktop
Originally submitted by
@codegold79
The text was updated successfully, but these errors were encountered: