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

Function resolveDocsTableWithIndex

internal/cmd/docs_table_column_width.go:181–194  ·  view source on GitHub ↗
(doc *docs.Document, requested int)

Source from the content-addressed store, hash-verified

179}
180
181func resolveDocsTableWithIndex(doc *docs.Document, requested int) (tableWithIndex, int, error) {
182 tables := collectAllTablesWithIndex(doc)
183 if len(tables) == 0 {
184 return tableWithIndex{}, 0, usage("document has no tables")
185 }
186 idx := requested
187 if idx < 0 {
188 idx = len(tables) + idx + 1
189 }
190 if idx < 1 || idx > len(tables) {
191 return tableWithIndex{}, 0, usagef("table %d out of range (document has %d tables)", requested, len(tables))
192 }
193 return tables[idx-1], idx, nil
194}
195
196func docsTableColumnCount(table *docs.Table) int {
197 if table == nil {

Callers 6

runTableRowColOpMethod · 0.85
runTableMergeMethod · 0.85
populateDocsTableRowFunction · 0.85
RunMethod · 0.85
RunMethod · 0.85

Calls 3

usageFunction · 0.85
usagefFunction · 0.85