main: fix the output if a wrong or none command provided
Signed-off-by: Vincent Batts <vbatts@hashbangbash.com>
This commit is contained in:
parent
9b8dbd620c
commit
01e8a6e859
1 changed files with 9 additions and 4 deletions
13
main.go
13
main.go
|
@ -15,12 +15,11 @@ import (
|
||||||
func main() {
|
func main() {
|
||||||
cmd := &cli.Command{
|
cmd := &cli.Command{
|
||||||
Name: "too-soon",
|
Name: "too-soon",
|
||||||
Usage: "check if something expires too soon",
|
Usage: "check if certificates expire too soon",
|
||||||
Version: "0.1",
|
Version: "0.1",
|
||||||
Authors: []any{
|
Authors: []any{
|
||||||
&mail.Address{Name: "Vincent Batts", Address: "vbatts@hashbangbash.com"},
|
&mail.Address{Name: "Vincent Batts", Address: "vbatts@hashbangbash.com"},
|
||||||
},
|
},
|
||||||
DefaultCommand: "pem",
|
|
||||||
Flags: []cli.Flag{
|
Flags: []cli.Flag{
|
||||||
&cli.IntFlag{
|
&cli.IntFlag{
|
||||||
Name: "days",
|
Name: "days",
|
||||||
|
@ -42,10 +41,16 @@ func main() {
|
||||||
},
|
},
|
||||||
Commands: []*cli.Command{
|
Commands: []*cli.Command{
|
||||||
&cli.Command{
|
&cli.Command{
|
||||||
Name: "pem",
|
Name: "pem",
|
||||||
Action: fPEMCheck,
|
Usage: "check if PEM certificate files expire too soon",
|
||||||
|
Action: fPEMCheck,
|
||||||
|
ArgsUsage: "[PEM files...]",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Action: func(ctx context.Context, cmd *cli.Command) error {
|
||||||
|
cli.ShowAppHelpAndExit(cmd, 1)
|
||||||
|
return nil
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := cmd.Run(context.Background(), os.Args); err != nil {
|
if err := cmd.Run(context.Background(), os.Args); err != nil {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue