2020-02-22 15:39:16 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
app := &cli.App{
|
|
|
|
Name: "SSL Certificate Checker",
|
|
|
|
Usage: "check SSL certificates at once",
|
|
|
|
Flags: []cli.Flag{
|
|
|
|
&cli.StringFlag{
|
2020-04-02 19:41:41 +01:00
|
|
|
Name: "config",
|
|
|
|
Aliases: []string{"C"},
|
2020-02-22 15:39:16 +00:00
|
|
|
Value: "",
|
2020-04-02 19:41:41 +01:00
|
|
|
Usage: "config file",
|
2020-02-22 15:39:16 +00:00
|
|
|
Required: true,
|
|
|
|
},
|
2020-05-10 10:03:11 +01:00
|
|
|
&cli.IntFlag{
|
|
|
|
Name: "timeout",
|
|
|
|
Aliases: []string{"t"},
|
|
|
|
Value: defaultDialerTimeout,
|
|
|
|
Usage: "dialer timeout in second(s)",
|
|
|
|
Required: false,
|
|
|
|
},
|
2020-02-22 15:39:16 +00:00
|
|
|
},
|
|
|
|
Action: func(c *cli.Context) error {
|
2020-05-10 10:03:11 +01:00
|
|
|
prettyPrintCertsInfo(c.String("config"), c.Int("timeout"))
|
2020-02-22 15:39:16 +00:00
|
|
|
return nil
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
err := app.Run(os.Args)
|
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|