2024-05-08 16:37:42 -04:00
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"os"
|
|
|
|
|
|
|
|
|
|
"github.com/urfave/cli/v2"
|
|
|
|
|
"github.com/urfave/cli/v2/altsrc"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
var options Options
|
|
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
|
// Defaults
|
2024-05-29 22:25:53 -04:00
|
|
|
options.LogLevel = "INFO"
|
2024-05-08 16:37:42 -04:00
|
|
|
options.LogEncoding = "console"
|
|
|
|
|
|
|
|
|
|
app := &cli.App{
|
2024-05-16 19:12:10 -04:00
|
|
|
Name: "storenode-messages",
|
|
|
|
|
Description: "storenode message counter",
|
|
|
|
|
Version: "0.0.1",
|
|
|
|
|
Before: altsrc.InitInputSourceWithContext(cliFlags, altsrc.NewTomlSourceFromFlagFunc("config-file")),
|
|
|
|
|
Flags: cliFlags,
|
2024-05-08 16:37:42 -04:00
|
|
|
Action: func(c *cli.Context) error {
|
2024-05-09 16:03:33 -04:00
|
|
|
return Execute(c.Context, options)
|
2024-05-08 16:37:42 -04:00
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
err := app.Run(os.Args)
|
|
|
|
|
if err != nil {
|
|
|
|
|
panic(err)
|
|
|
|
|
}
|
|
|
|
|
}
|