(args []string)
| 149 | } |
| 150 | |
| 151 | func (c *serverCmd) checkFlags(args []string) error { |
| 152 | if len(args) != 0 { |
| 153 | c.Usage() |
| 154 | } |
| 155 | if c.mini { |
| 156 | if c.things { |
| 157 | return cmdmain.UsageError("--mini and --makethings are mutually exclusive.") |
| 158 | } |
| 159 | c.publish = false |
| 160 | c.scancab = false |
| 161 | c.hello = false |
| 162 | } |
| 163 | if c.things && !c.wipe { |
| 164 | return cmdmain.UsageError("--makethings requires --wipe.") |
| 165 | } |
| 166 | nindex := 0 |
| 167 | for _, v := range []bool{c.mongo, c.mysql, c.postgres, c.sqlite, c.memory, c.kvfile} { |
| 168 | if v { |
| 169 | nindex++ |
| 170 | } |
| 171 | } |
| 172 | if nindex > 1 { |
| 173 | return fmt.Errorf("Only one index option allowed") |
| 174 | } |
| 175 | |
| 176 | if _, err := strconv.ParseInt(c.port, 0, 0); err != nil { |
| 177 | return fmt.Errorf("Invalid -port value: %q", c.port) |
| 178 | } |
| 179 | return nil |
| 180 | } |
| 181 | |
| 182 | func (c *serverCmd) setRoot() error { |
| 183 | if c.root == "" { |
no test coverage detected