diff options
author | Cody Hiar <cody@hiar.ca> | 2022-03-05 12:53:15 -0700 |
---|---|---|
committer | Cody Hiar <cody@hiar.ca> | 2022-03-05 12:53:15 -0700 |
commit | 90e2e053d25feabd2dcf384dfc262a8bcdbe3ab8 (patch) | |
tree | 8e2799822b4de29014b86ca708123c1dfc8f45f5 /termshare/cmd/daemon.go |
Diffstat (limited to 'termshare/cmd/daemon.go')
-rw-r--r-- | termshare/cmd/daemon.go | 25 |
1 files changed, 25 insertions, 0 deletions
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) +} + |