devcam: option to add args to camlistored exec.

Handy catch-all for camlistored args we haven't plummed through to
devcam server in the proper manner.  Example use:

	$ devcam server -extraargs=-reindex

Change-Id: I4af922e4c95728dc7858fa2db9e60c7efd37a3cb
This commit is contained in:
Bill Thiede 2013-12-24 21:35:48 -08:00
parent fe25884b71
commit bab46f1db5
1 changed files with 6 additions and 0 deletions

View File

@ -62,6 +62,7 @@ type serverCmd struct {
openBrowser bool
flickrAPIKey string
extraArgs string // passed to camlistored
// end of flag vars
listen string // address + port to listen on
@ -94,6 +95,8 @@ func init() {
flags.BoolVar(&cmd.openBrowser, "openbrowser", false, "Open the start page on startup.")
flags.StringVar(&cmd.flickrAPIKey, "flickrapikey", "", "The key and secret to use with the Flickr importer. Formatted as '<key>:<secret>'.")
flags.StringVar(&cmd.extraArgs, "extraargs", "",
"List of comma separated options that will be passed to camlistored")
return cmd
})
}
@ -377,5 +380,8 @@ func (c *serverCmd) RunCommand(args []string) error {
"-listen=" + c.listen,
"-openbrowser=" + strconv.FormatBool(c.openBrowser),
}
if c.extraArgs != "" {
cmdArgs = append(cmdArgs, strings.Split(c.extraArgs, ",")...)
}
return runExec(camliBin, cmdArgs, c.env)
}