summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/spf13/cobra/doc/util.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/spf13/cobra/doc/util.go')
-rw-r--r--vendor/github.com/spf13/cobra/doc/util.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/vendor/github.com/spf13/cobra/doc/util.go b/vendor/github.com/spf13/cobra/doc/util.go
index a1c6b89ba..a7d2765a9 100644
--- a/vendor/github.com/spf13/cobra/doc/util.go
+++ b/vendor/github.com/spf13/cobra/doc/util.go
@@ -13,7 +13,11 @@
package doc
-import "github.com/spf13/cobra"
+import (
+ "strings"
+
+ "github.com/spf13/cobra"
+)
// Test to see if we have a reason to print See Also information in docs
// Basically this is a test for a parent commend or a subcommand which is
@@ -31,6 +35,15 @@ func hasSeeAlso(cmd *cobra.Command) bool {
return false
}
+// Temporary workaround for yaml lib generating incorrect yaml with long strings
+// that do not contain \n.
+func forceMultiLine(s string) string {
+ if len(s) > 60 && !strings.Contains(s, "\n") {
+ s = s + "\n"
+ }
+ return s
+}
+
type byName []*cobra.Command
func (s byName) Len() int { return len(s) }