| 34 | } |
| 35 | |
| 36 | func newLintCmd() *cli.Command { |
| 37 | return &cli.Command{ |
| 38 | Name: "lint", |
| 39 | Usage: "Check a commit message", |
| 40 | Description: "Reads from stdin (piped), or --message file, or .git/COMMIT_EDITMSG (in that order).", |
| 41 | Flags: []cli.Flag{ |
| 42 | &cli.StringFlag{ |
| 43 | Name: "config", |
| 44 | Aliases: []string{"c"}, |
| 45 | Usage: "Use this config `FILE` instead of auto-detected one", |
| 46 | }, |
| 47 | &cli.StringFlag{ |
| 48 | Name: "message", |
| 49 | Aliases: []string{"m", "msg"}, |
| 50 | Usage: "Read commit message from `FILE`", |
| 51 | }, |
| 52 | }, |
| 53 | Action: func(ctx *cli.Context) error { |
| 54 | confFilePath := ctx.String("config") |
| 55 | fileInput := ctx.String("message") |
| 56 | return lintMsg(confFilePath, fileInput) |
| 57 | }, |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func newInitCmd() *cli.Command { |
| 62 | return &cli.Command{ |