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

Method validate

internal/cmd/docs_table_column_width.go:126–149  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

124}
125
126func (c *DocsTableColumnWidthCmd) validate() error {
127 if c.TableIndex == 0 {
128 return usage("--table-index cannot be 0")
129 }
130 if c.Col < 0 {
131 return usage("--col must be >= 1")
132 }
133 if c.EvenlyDistributed {
134 if c.Width != 0 {
135 return usage("--width and --evenly-distributed are mutually exclusive")
136 }
137 return nil
138 }
139 if c.Width == 0 {
140 return usage("set --width or --evenly-distributed")
141 }
142 if c.Width < 5 {
143 return usage("--width must be >= 5pt")
144 }
145 if c.Col < 1 {
146 return usage("--col is required when setting --width")
147 }
148 return nil
149}
150
151func (c *DocsTableColumnWidthCmd) buildRequest(tableStart int64, colCount int, tabID string) (*docs.Request, error) {
152 if colCount < 1 {

Callers 1

RunMethod · 0.95

Calls 1

usageFunction · 0.85

Tested by

no test coverage detected