This commit is contained in:
Henrique Dias 2017-01-14 11:04:04 +00:00
parent b192da1982
commit 282a93d705

View File

@ -119,19 +119,14 @@ func parse(c *caddy.Controller, root string) (*Config, *filemanager.FileManager,
return cfg, &filemanager.FileManager{}, c.ArgErr() return cfg, &filemanager.FileManager{}, c.ArgErr()
} }
values := strings.Split(c.Val(), " ") flag := c.Val()
if len(values) == 0 {
return cfg, fm, errors.New("Not enough arguments for 'flag' option.")
}
value := "true" value := "true"
if len(values) > 1 { if c.NextArg() {
value = values[1] value = c.Val()
} }
cfg.Args = append(cfg.Args, "--"+values[0]+"="+value) cfg.Args = append(cfg.Args, "--"+flag+"="+value)
case "before_publish": case "before_publish":
if cfg.BeforePublish, err = config.CommandRunner(c); err != nil { if cfg.BeforePublish, err = config.CommandRunner(c); err != nil {
return cfg, &filemanager.FileManager{}, err return cfg, &filemanager.FileManager{}, err