INNER CODE UNIT · Go

result

dropbox/dbxcli · tools/gen-docs/main.go:130

	result := make([]byte, 0, len(contents)+len(section)+1)
	result = append(result, contents[:index]...)
	result = append(result, '\n')
	result = append(result, section...)
	result = append(result, contents[index:]...)
	return result
}

func commandMetadataSection(command *cobra.Command) []byte {
	manifest := cmd.CommandManifestFor(command)
	var buf bytes.Buffer
	buf.WriteString("### Command metadata\n\n")
	fmt.Fprintf(&buf, "* Structured JSON output: %s\n", yesNo(manifest.SupportsStructuredOutput))
	buf.WriteString("* JSON help manifest: yes\n")
	buf.WriteString("* Manifest version: `" + manifest.ManifestVersion + "`\n")
	buf.WriteString("* Auth modes: " + markdownValueList(manifest.AuthModes) + "\n")
	buf.WriteString("* Dropbox scopes: " + markdownValueList(manifest.DropboxScopes) + "\n")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…