MCPcopy Create free account
hub / github.com/openclaw/gogcli / Run

Method Run

internal/cmd/docs_comments.go:36–77  ·  view source on GitHub ↗
(ctx context.Context, flags *RootFlags)

Source from the content-addressed store, hash-verified

34}
35
36func (c *DocsCommentsListCmd) Run(ctx context.Context, flags *RootFlags) error {
37 u := ui.FromContext(ctx)
38 docID := normalizeGoogleID(strings.TrimSpace(c.DocID))
39 if docID == "" {
40 return usage("empty docId")
41 }
42 if c.Max <= 0 {
43 return usage("max must be > 0")
44 }
45 since, err := normalizeDriveCommentSince(c.Since)
46 if err != nil {
47 return err
48 }
49
50 _, svc, err := requireDriveService(ctx, flags)
51 if err != nil {
52 return err
53 }
54 comments, nextPageToken, err := listDriveComments(ctx, svc, docID, driveCommentListOptions{
55 resourceKey: "docId",
56 resourceID: docID,
57 includeResolved: c.IncludeResolved,
58 scanForOpen: true,
59 page: c.Page,
60 since: since,
61 all: c.All,
62 failEmpty: c.FailEmpty,
63 max: c.Max,
64 emptyMessage: "No comments",
65 mode: driveCommentListModeExpanded,
66 })
67 if err != nil {
68 return err
69 }
70 return writeDriveCommentList(ctx, u, driveCommentListOptions{
71 resourceKey: "docId",
72 resourceID: docID,
73 failEmpty: c.FailEmpty,
74 emptyMessage: "No comments",
75 mode: driveCommentListModeExpanded,
76 }, comments, nextPageToken)
77}
78
79// DocsCommentsGetCmd retrieves a single comment by ID.
80type DocsCommentsGetCmd struct {

Callers

nothing calls this directly

Calls 7

FromContextFunction · 0.92
normalizeGoogleIDFunction · 0.85
usageFunction · 0.85
requireDriveServiceFunction · 0.85
listDriveCommentsFunction · 0.85
writeDriveCommentListFunction · 0.85

Tested by

no test coverage detected