summaryrefslogtreecommitdiff
path: root/termshare/cmd/daemon.go
blob: 3ae3f39f5296d053a678dd9e5d81467a91150fdd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package cmd

import (
    "termshare/internal/daemon"

	"github.com/spf13/cobra"
)

var (
    flagPort string
)

func init() {
    cmd := &cobra.Command{
        Use: "daemon",
        Short: "Run the daemon command",
        Long: "run the daemon command",
        Run: func(cmd *cobra.Command, args []string) {
            daemon.RunDaemon(flagPort)
        },
    }
    cmd.PersistentFlags().StringVarP(&flagPort, "port", "", "8080", "The port the daemon should listen to")
    rootCmd.AddCommand(cmd)
}