Skip to content

Commit 2229594

Browse files
authored
refactor: show command help message. (#1486)
1 parent be6edad commit 2229594

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

cmd/admin.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ package cmd
88
import (
99
"fmt"
1010

11-
"github.com/urfave/cli"
12-
1311
"code.gitea.io/gitea/models"
1412
"code.gitea.io/gitea/modules/setting"
13+
14+
"github.com/urfave/cli"
1515
)
1616

1717
var (

cmd/dump.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616

1717
"code.gitea.io/gitea/models"
1818
"code.gitea.io/gitea/modules/setting"
19+
1920
"github.com/Unknwon/cae/zip"
2021
"github.com/Unknwon/com"
2122
"github.com/urfave/cli"

cmd/serv.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import (
1717
"code.gitea.io/gitea/models"
1818
"code.gitea.io/gitea/modules/log"
1919
"code.gitea.io/gitea/modules/setting"
20+
2021
"github.com/Unknwon/com"
2122
"github.com/dgrijalva/jwt-go"
2223
"github.com/urfave/cli"
@@ -105,7 +106,8 @@ func runServ(c *cli.Context) error {
105106
}
106107

107108
if len(c.Args()) < 1 {
108-
fail("Not enough arguments", "Not enough arguments")
109+
cli.ShowSubcommandHelp(c)
110+
return nil
109111
}
110112

111113
cmd := os.Getenv("SSH_ORIGINAL_COMMAND")

cmd/web_graceful.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import (
1111
"net/http"
1212

1313
"code.gitea.io/gitea/modules/log"
14+
1415
"github.com/facebookgo/grace/gracehttp"
1516
)
1617

0 commit comments

Comments
 (0)