diff options
author | Marin Jankovski <maxlazio@gmail.com> | 2016-04-07 17:49:12 +0300 |
---|---|---|
committer | Marin Jankovski <maxlazio@gmail.com> | 2016-04-07 17:49:12 +0300 |
commit | 7916df94fa9a4df1515e166f2213727de53085fe (patch) | |
tree | 5c2f6b7d53bb72e55ba1ce0a2841825162cd75ba /main.go | |
parent | 5718c3d05ff94d2ebe020eeac02678926b2fe000 (diff) |
Reduce complexity.
Diffstat (limited to 'main.go')
-rw-r--r-- | main.go | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -30,15 +30,11 @@ func appMain() { flag.Parse() - version := VERSION + "-" + REVISION - if *showVersion { - log.SetFlags(0) - log.Printf(version) - os.Exit(0) - } + printVersion(*showVersion, VERSION) log.Printf("GitLab Pages Daemon %s (%s)", VERSION, REVISION) log.Printf("URL: https://gitlab.com/gitlab-org/gitlab-pages\n") + err := os.Chdir(*pagesRoot) if err != nil { log.Fatalln(err) @@ -83,6 +79,14 @@ func appMain() { runApp(config) } +func printVersion(showVersion bool, version string) { + if showVersion { + log.SetFlags(0) + log.Printf(version) + os.Exit(0) + } +} + func main() { log.SetOutput(os.Stderr) |