From 90e2e053d25feabd2dcf384dfc262a8bcdbe3ab8 Mon Sep 17 00:00:00 2001 From: Cody Hiar Date: Sat, 5 Mar 2022 12:53:15 -0700 Subject: Initial Commit --- termshare/cmd/daemon.go | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 termshare/cmd/daemon.go (limited to 'termshare/cmd/daemon.go') diff --git a/termshare/cmd/daemon.go b/termshare/cmd/daemon.go new file mode 100644 index 0000000..3ae3f39 --- /dev/null +++ b/termshare/cmd/daemon.go @@ -0,0 +1,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) +} + -- cgit v1.2.3