-
Notifications
You must be signed in to change notification settings - Fork 45
Expand file tree
/
Copy pathhelptext.go
More file actions
40 lines (35 loc) · 1.78 KB
/
Copy pathhelptext.go
File metadata and controls
40 lines (35 loc) · 1.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package cmds
// HTTPHelpText contains documentation specific to HTTP API responses.
// This is used by tools like http-api-docs to generate API reference
// for HTTP endpoints (e.g., /api/v0/* in Kubo).
type HTTPHelpText struct {
// ResponseContentType documents the Content-Type header of successful responses.
// This can be a simple MIME type like "application/vnd.ipld.car" or include
// additional notes in free-form text, e.g., "application/x-tar, or
// application/gzip when compress=true".
// If empty, documentation tools infer from the command's Type field or default to text/plain.
ResponseContentType string
// Description provides additional HTTP-specific description text.
// This is rendered after HelpText.Tagline in HTTP API documentation.
// Use this to document HTTP-specific behavior, caveats, or notes that
// don't apply to CLI usage. If empty, only Tagline is shown.
Description string
}
// HelpText is a set of strings used to generate command help text. The help
// text follows formats similar to man pages, but not exactly the same.
type HelpText struct {
// required
Tagline string // used in <cmd usage>
ShortDescription string // used in DESCRIPTION
SynopsisOptionsValues map[string]string // mappings for synopsis generator
// optional - whole section overrides
Usage string // overrides USAGE section
LongDescription string // overrides DESCRIPTION section
Options string // overrides OPTIONS section
Arguments string // overrides ARGUMENTS section
Subcommands string // overrides SUBCOMMANDS section
Synopsis string // overrides SYNOPSIS field
// HTTP contains documentation specific to the HTTP API.
// When nil, defaults are derived from other HelpText fields.
HTTP *HTTPHelpText
}