Skip to content

Commit

Permalink
Merge pull request #4 from SashaCrofter/f.gen-only
Browse files Browse the repository at this point in the history
Add --generate-only flag
  • Loading branch information
mna committed Aug 4, 2013
2 parents 15df488 + ea3acf4 commit f819db0
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
// This structure holds the command-line options.
type options struct {
Port int `short:"p" long:"port" description:"the port to use for the web server" default:"9000"`
GenOnly bool `short:"g" long:"generate-only" description:"generate the static site and exit"`
NoGen bool `short:"G" long:"no-generation" description:"when set, the site is not automatically generated"`
SiteName string `short:"n" long:"site-name" description:"the name of the site" default:"Site Name"`
TagLine string `short:"t" long:"tag-line" description:"the site's tag line"`
Expand Down Expand Up @@ -62,6 +63,12 @@ func main() {
if err := generateSite(); err != nil {
log.Fatal("FATAL ", err)
}

// Terminate if set to generate only
if Options.GenOnly {
return
}

// Start the watcher
defer startWatcher().Close()
}
Expand Down

0 comments on commit f819db0

Please sign in to comment.