From 22295944dff9da50cde6c1abb0d8ea4cff753bdf Mon Sep 17 00:00:00 2001 From: Bo-Yi Wu Date: Wed, 12 Apr 2017 15:44:54 +0800 Subject: [PATCH] refactor: show command help message. (#1486) --- cmd/admin.go | 4 ++-- cmd/dump.go | 1 + cmd/serv.go | 4 +++- cmd/web_graceful.go | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cmd/admin.go b/cmd/admin.go index d4240e17c0..aec1b8dad4 100644 --- a/cmd/admin.go +++ b/cmd/admin.go @@ -8,10 +8,10 @@ package cmd import ( "fmt" - "github.com/urfave/cli" - "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/setting" + + "github.com/urfave/cli" ) var ( diff --git a/cmd/dump.go b/cmd/dump.go index ad095ed3b4..98478c17be 100644 --- a/cmd/dump.go +++ b/cmd/dump.go @@ -16,6 +16,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/setting" + "github.com/Unknwon/cae/zip" "github.com/Unknwon/com" "github.com/urfave/cli" diff --git a/cmd/serv.go b/cmd/serv.go index e3aeb41c56..d7e89ab98d 100644 --- a/cmd/serv.go +++ b/cmd/serv.go @@ -17,6 +17,7 @@ import ( "code.gitea.io/gitea/models" "code.gitea.io/gitea/modules/log" "code.gitea.io/gitea/modules/setting" + "github.com/Unknwon/com" "github.com/dgrijalva/jwt-go" "github.com/urfave/cli" @@ -105,7 +106,8 @@ func runServ(c *cli.Context) error { } if len(c.Args()) < 1 { - fail("Not enough arguments", "Not enough arguments") + cli.ShowSubcommandHelp(c) + return nil } cmd := os.Getenv("SSH_ORIGINAL_COMMAND") diff --git a/cmd/web_graceful.go b/cmd/web_graceful.go index b0b3093b68..e54561f163 100644 --- a/cmd/web_graceful.go +++ b/cmd/web_graceful.go @@ -11,6 +11,7 @@ import ( "net/http" "code.gitea.io/gitea/modules/log" + "github.com/facebookgo/grace/gracehttp" )