Files
2025-07-17 16:29:44 -05:00

44 lines
783 B
Go

// Copyright (C) 2021-2025, Lux Industries Inc. All rights reserved.
// See the file LICENSE for licensing terms.
package cmd
import (
"fmt"
"os"
"github.com/luxfi/netrunner/cmd/control"
"github.com/luxfi/netrunner/cmd/ping"
"github.com/luxfi/netrunner/cmd/server"
"github.com/spf13/cobra"
)
var Version = ""
var rootCmd = &cobra.Command{
Use: "netrunner",
Short: "netrunner commands",
SuggestFor: []string{"network-runner"},
Version: Version,
}
func init() {
cobra.EnablePrefixMatching = true
}
func init() {
rootCmd.AddCommand(
server.NewCommand(),
ping.NewCommand(),
control.NewCommand(),
)
}
func Execute() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintf(os.Stderr, "netrunner failed %v\n", err)
os.Exit(1)
}
os.Exit(0)
}