2021-09-14 16:22:42 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
2021-10-13 11:23:03 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/cmd/neofs-lens/internal/commands/inspect"
|
2021-09-14 16:24:10 +00:00
|
|
|
cmdlist "github.com/nspcc-dev/neofs-node/cmd/neofs-lens/internal/commands/list"
|
2021-09-14 16:22:42 +00:00
|
|
|
"github.com/nspcc-dev/neofs-node/misc"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
var command = &cobra.Command{
|
|
|
|
Use: "neofs-lens",
|
|
|
|
Short: "NeoFS Storage Engine Lens",
|
|
|
|
Long: `NeoFS Storage Engine Lens provides tools to browse the contents of the NeoFS storage engine.`,
|
|
|
|
RunE: entryPoint,
|
|
|
|
SilenceUsage: true,
|
|
|
|
}
|
|
|
|
|
|
|
|
func entryPoint(cmd *cobra.Command, _ []string) error {
|
|
|
|
printVersion, err := cmd.Flags().GetBool("version")
|
|
|
|
if err == nil && printVersion {
|
|
|
|
fmt.Printf("Version: %s \nBuild: %s \nDebug: %s\n",
|
|
|
|
misc.Version,
|
|
|
|
misc.Build,
|
|
|
|
misc.Debug,
|
|
|
|
)
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
|
|
|
|
return cmd.Usage()
|
|
|
|
}
|
|
|
|
|
|
|
|
func init() {
|
|
|
|
command.AddCommand(
|
2021-09-14 16:24:10 +00:00
|
|
|
cmdlist.Command,
|
2021-10-13 11:23:03 +00:00
|
|
|
inspect.Command,
|
2021-09-14 16:22:42 +00:00
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
err := command.Execute()
|
|
|
|
if err != nil {
|
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|