This repository has been archived on 2024-04-07. You can view files and clone it, but cannot push or open issues or pull requests.
go-monero/cmd/monero/main.go
2022-10-05 09:40:23 +02:00

48 lines
1,001 B
Go

package main
import (
"fmt"
"os"
"github.com/spf13/cobra"
"git.gammaspectra.live/P2Pool/go-monero/cmd/monero/commands/address"
"git.gammaspectra.live/P2Pool/go-monero/cmd/monero/commands/daemon"
"git.gammaspectra.live/P2Pool/go-monero/cmd/monero/commands/p2p"
"git.gammaspectra.live/P2Pool/go-monero/cmd/monero/commands/wallet"
)
var (
version = "dev"
commit = "dev"
)
var rootCmd = &cobra.Command{
Use: "monero",
Short: "Daemon, Wallet, and p2p command line monero CLI",
}
// nolint:forbidigo
var versionCmd = &cobra.Command{
Use: "version",
Short: "print the version of this cli",
Run: func(_ *cobra.Command, _ []string) {
fmt.Println(version, commit)
},
}
func init() {
rootCmd.AddCommand(daemon.RootCommand)
rootCmd.AddCommand(wallet.RootCommand)
rootCmd.AddCommand(p2p.RootCommand)
rootCmd.AddCommand(address.RootCommand)
rootCmd.AddCommand(versionCmd)
}
func main() {
if err := rootCmd.Execute(); err != nil {
fmt.Fprintln(os.Stderr, err)
os.Exit(1)
}
}