| 124 | } |
| 125 | |
| 126 | func (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 | |
| 151 | func (c *DocsTableColumnWidthCmd) buildRequest(tableStart int64, colCount int, tabID string) (*docs.Request, error) { |
| 152 | if colCount < 1 { |