feat: kubesphere 4.0 (#6115)
* feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> * feat: kubesphere 4.0 Signed-off-by: ci-bot <ci-bot@kubesphere.io> --------- Signed-off-by: ci-bot <ci-bot@kubesphere.io> Co-authored-by: ks-ci-bot <ks-ci-bot@example.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
committed by
GitHub
parent
b5015ec7b9
commit
447a51f08b
4
vendor/k8s.io/kubectl/pkg/util/templates/markdown.go
generated
vendored
4
vendor/k8s.io/kubectl/pkg/util/templates/markdown.go
generated
vendored
@@ -58,7 +58,9 @@ func (r *ASCIIRenderer) RenderNode(w io.Writer, node *blackfriday.Node, entering
|
||||
lines := []string{}
|
||||
for _, line := range strings.Split(string(node.Literal), linebreak) {
|
||||
trimmed := strings.Trim(line, " \t")
|
||||
indented := r.Indentation + trimmed
|
||||
// Adding 4 times of indentation will let blackfriday to accept
|
||||
// this literal as Code or CodeBlock again in next invocation
|
||||
indented := strings.Repeat(r.Indentation, 4) + trimmed
|
||||
lines = append(lines, indented)
|
||||
}
|
||||
w.Write([]byte(strings.Join(lines, linebreak)))
|
||||
|
||||
10
vendor/k8s.io/kubectl/pkg/util/templates/templater.go
generated
vendored
10
vendor/k8s.io/kubectl/pkg/util/templates/templater.go
generated
vendored
@@ -126,6 +126,7 @@ func (templater *templater) templateFuncs(exposedFlags ...string) template.FuncM
|
||||
"isRootCmd": templater.isRootCmd,
|
||||
"optionsCmdFor": templater.optionsCmdFor,
|
||||
"usageLine": templater.usageLine,
|
||||
"reverseParentsNames": templater.reverseParentsNames,
|
||||
"exposed": func(c *cobra.Command) *flag.FlagSet {
|
||||
exposed := flag.NewFlagSet("exposed", flag.ContinueOnError)
|
||||
if len(exposedFlags) > 0 {
|
||||
@@ -172,6 +173,15 @@ func (t *templater) rootCmdName(c *cobra.Command) string {
|
||||
return t.rootCmd(c).CommandPath()
|
||||
}
|
||||
|
||||
func (t *templater) reverseParentsNames(c *cobra.Command) []string {
|
||||
reverseParentsNames := []string{}
|
||||
parents := t.parents(c)
|
||||
for i := len(parents) - 1; i >= 0; i-- {
|
||||
reverseParentsNames = append(reverseParentsNames, parents[i].Name())
|
||||
}
|
||||
return reverseParentsNames
|
||||
}
|
||||
|
||||
func (t *templater) isRootCmd(c *cobra.Command) bool {
|
||||
return t.rootCmd(c) == c
|
||||
}
|
||||
|
||||
5
vendor/k8s.io/kubectl/pkg/util/templates/templates.go
generated
vendored
5
vendor/k8s.io/kubectl/pkg/util/templates/templates.go
generated
vendored
@@ -28,7 +28,8 @@ const (
|
||||
`{{$visibleFlags := visibleFlags (flagsNotIntersected .LocalFlags .PersistentFlags)}}` +
|
||||
`{{$explicitlyExposedFlags := exposed .}}` +
|
||||
`{{$optionsCmdFor := optionsCmdFor .}}` +
|
||||
`{{$usageLine := usageLine .}}`
|
||||
`{{$usageLine := usageLine .}}` +
|
||||
`{{$reverseParentsNames := reverseParentsNames .}}`
|
||||
|
||||
// SectionAliases is the help template section that displays command aliases.
|
||||
SectionAliases = `{{if gt .Aliases 0}}Aliases:
|
||||
@@ -61,7 +62,7 @@ const (
|
||||
{{end}}`
|
||||
|
||||
// SectionTipsHelp is the help template section that displays the '--help' hint.
|
||||
SectionTipsHelp = `{{if .HasSubCommands}}Use "{{$rootCmd}} <command> --help" for more information about a given command.
|
||||
SectionTipsHelp = `{{if .HasSubCommands}}Use "{{range $reverseParentsNames}}{{.}} {{end}}<command> --help" for more information about a given command.
|
||||
{{end}}`
|
||||
|
||||
// SectionTipsGlobalOptions is the help template section that displays the 'options' hint for displaying global flags.
|
||||
|
||||
Reference in New Issue
Block a user