2021-09-14 16:22:42 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2022-12-23 17:35:35 +00:00
|
|
|
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-lens/internal/blobovnicza"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-lens/internal/meta"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-lens/internal/writecache"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/misc"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/pkg/util/gendoc"
|
2021-09-14 16:22:42 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var command = &cobra.Command{
|
2022-12-23 17:35:35 +00:00
|
|
|
Use: "frostfs-lens",
|
2023-01-27 10:45:47 +00:00
|
|
|
Short: "FrostFS Storage Engine Lens",
|
|
|
|
Long: `FrostFS Storage Engine Lens provides tools to browse the contents of the FrostFS storage engine.`,
|
2021-09-14 16:22:42 +00:00
|
|
|
RunE: entryPoint,
|
|
|
|
SilenceUsage: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
func entryPoint(cmd *cobra.Command, _ []string) error {
|
2022-07-13 07:33:07 +00:00
|
|
|
printVersion, _ := cmd.Flags().GetBool("version")
|
|
|
|
if printVersion {
|
2023-01-27 10:41:03 +00:00
|
|
|
cmd.Print(misc.BuildInfo("FrostFS Lens"))
|
2022-07-08 12:45:21 +00:00
|
|
|
|
2021-09-14 16:22:42 +00:00
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return cmd.Usage()
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
2022-08-06 21:16:04 +00:00
|
|
|
// use stdout as default output for cmd.Print()
|
|
|
|
command.SetOut(os.Stdout)
|
2022-10-11 14:02:03 +00:00
|
|
|
command.Flags().Bool("version", false, "Application version")
|
2021-09-14 16:22:42 +00:00
|
|
|
command.AddCommand(
|
2022-08-23 13:45:24 +00:00
|
|
|
blobovnicza.Root,
|
2022-08-23 14:05:32 +00:00
|
|
|
meta.Root,
|
2022-08-23 13:45:24 +00:00
|
|
|
writecache.Root,
|
2022-05-18 15:21:54 +00:00
|
|
|
gendoc.Command(command),
|
2021-09-14 16:22:42 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
err := command.Execute()
|
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|