summaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/main.go b/main.go
index 3baf6c275..d04012111 100644
--- a/main.go
+++ b/main.go
@@ -19,22 +19,19 @@ import (
"os"
"github.com/gohugoio/hugo/commands"
- jww "github.com/spf13/jwalterweatherman"
)
func main() {
runtime.GOMAXPROCS(runtime.NumCPU())
- commands.Execute()
+ resp := commands.Execute(os.Args[1:])
- if jww.LogCountForLevelsGreaterThanorEqualTo(jww.LevelError) > 0 {
+ if resp.Err != nil {
+ if resp.IsUserError() {
+ resp.Cmd.Println("")
+ resp.Cmd.Println(resp.Cmd.UsageString())
+ }
os.Exit(-1)
}
- // TODO(bep) cli refactor
- /*if commands.Hugo != nil {
- if commands.Hugo.Log.LogCountForLevelsGreaterThanorEqualTo(jww.LevelError) > 0 {
- os.Exit(-1)
- }
- }*/
}