Add flag to only generate registry overview once (#29)

Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
Patrick Uiterwijk 2017-06-27 22:43:05 +02:00 committed by Jess Frazelle
parent c1412f3d53
commit 78e58d7811

View file

@ -70,6 +70,10 @@ func main() {
Name: "insecure, k", Name: "insecure, k",
Usage: "do not verify tls certificates of registry", Usage: "do not verify tls certificates of registry",
}, },
cli.BoolFlag{
Name: "once, o",
Usage: "generate an output once and then exit",
},
cli.StringFlag{ cli.StringFlag{
Name: "port", Name: "port",
Value: "8080", Value: "8080",
@ -183,6 +187,11 @@ func main() {
logrus.Fatalf("Error creating index: %v", err) logrus.Fatalf("Error creating index: %v", err)
} }
if c.GlobalBool("once") {
logrus.Info("Output generated")
return nil
}
// parse the duration // parse the duration
dur, err := time.ParseDuration(c.String("interval")) dur, err := time.ParseDuration(c.String("interval"))
if err != nil { if err != nil {