MCPcopy
hub / github.com/perkeep/perkeep / checkFlags

Method checkFlags

dev/devcam/server.go:151–180  ·  view source on GitHub ↗
(args []string)

Source from the content-addressed store, hash-verified

149}
150
151func (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
182func (c *serverCmd) setRoot() error {
183 if c.root == "" {

Callers 1

RunCommandMethod · 0.95

Calls 2

UsageMethod · 0.95
UsageErrorTypeAlias · 0.92

Tested by

no test coverage detected