1
0
mirror of https://github.com/danog/gojekyll.git synced 2025-01-23 00:41:13 +01:00
gojekyll/config/flags.go
2017-07-01 15:13:32 -04:00

27 lines
630 B
Go

package config
// Flags are applied after the configuration file is loaded.
// They are pointers to represent optional types, to tell whether they have been set.
type Flags struct {
Destination *string
Unpublished *bool
Drafts *bool
Future *bool
}
// ApplyFlags overwrites the configuration with values from flags.
func (c *Config) ApplyFlags(flags Flags) {
if flags.Destination != nil {
c.Destination = *flags.Destination
}
if flags.Drafts != nil {
c.Drafts = *flags.Drafts
}
if flags.Future != nil {
c.Future = *flags.Future
}
if flags.Unpublished != nil {
c.Unpublished = *flags.Unpublished
}
}