mirror of
https://github.com/genuinetools/reg.git
synced 2024-09-28 11:46:20 -04:00
Add flag to only generate registry overview once (#29)
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
This commit is contained in:
parent
c1412f3d53
commit
78e58d7811
1 changed files with 9 additions and 0 deletions
|
@ -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 {
|
||||||
|
|
Loading…
Reference in a new issue