root.go 709 Bytes
Newer Older
ElyKar's avatar
ElyKar committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
package cmd

import (
	"dfss"

	"github.com/spf13/cobra"
	"github.com/spf13/viper"
)

// RootCmd is the main command for the dfssd application
var RootCmd = &cobra.Command{
	Use:   "dfssd",
	Short: "Demonstrator for the DFSS project",
	Long: "Demonstrator v" + dfss.Version + ` for the
Distributed Fair Signing System project

Debug tool to trace remote transmissions`,
18
	Run: guiCmd.Run,
ElyKar's avatar
ElyKar committed
19
20
21
22
}

func init() {
	// Add flag to the command
23
	RootCmd.PersistentFlags().IntP("port", "p", 9099, "port to use for listening transmissions")
ElyKar's avatar
ElyKar committed
24
25
26
27
28

	// Bind the flag to viper
	_ = viper.BindPFlag("port", RootCmd.PersistentFlags().Lookup("port"))

	// Register subcommands
29
	RootCmd.AddCommand(dfss.VersionCmd, noguiCmd, guiCmd)
ElyKar's avatar
ElyKar committed
30
}