All checks were successful
ci/woodpecker/push/build Pipeline was successful
44 lines
919 B
Go
44 lines
919 B
Go
package main
|
|
|
|
import (
|
|
"github.com/urfave/cli/v2"
|
|
"gitnet.fr/deblan/expiration-check/checker"
|
|
"gitnet.fr/deblan/expiration-check/render"
|
|
)
|
|
|
|
func App() *cli.App {
|
|
flags := []cli.Flag{
|
|
&cli.StringSliceFlag{
|
|
Name: "domain",
|
|
Aliases: []string{"d"},
|
|
Required: true,
|
|
},
|
|
}
|
|
|
|
return &cli.App{
|
|
Commands: []*cli.Command{
|
|
{
|
|
Name: "certificate",
|
|
Aliases: []string{"c", "cert", "certs", "certificates"},
|
|
Usage: "Checks certificate",
|
|
Flags: flags,
|
|
Action: func(c *cli.Context) error {
|
|
render.Render(checker.CheckCertificates(c.StringSlice("domain")), 30, 14)
|
|
|
|
return nil
|
|
},
|
|
},
|
|
{
|
|
Name: "domain",
|
|
Usage: "Checks domain expirations",
|
|
Aliases: []string{"d", "domains"},
|
|
Flags: flags,
|
|
Action: func(c *cli.Context) error {
|
|
render.Render(checker.CheckDomains(c.StringSlice("domain")), 30, 14)
|
|
|
|
return nil
|
|
},
|
|
},
|
|
},
|
|
}
|
|
}
|